Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1396115
    Paul R
    Moderator

    Hi,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #1396513
    ili333
    Participant
    This reply has been marked as private.
    #1397884
    Lely
    Moderator

    Hi There,

    Thank you for the screenshot.
    See attached screenshot of what I am seeing right now. The code is working as expected. Adding the Weiterlesen square button at the end of the excerpt. The only thing that I found weird is the Read text at the end of the excerpt. You don’t have plugins that might cause this. There’s also no code on your functions.php that will add this text. I tried to login to your site hosting using FTP but my connection was refused by your server. Did you in any case, edited the main X theme files?

    #1397904
    ili333
    Participant

    Not that I know, never edited the main x theme files.

    #1397915
    ili333
    Participant

    I also feel strange about that short “read” text inside the box.

    #1398093
    ili333
    Participant

    And now I´m facing with a problem without knowing how it came to that. Please have a look at my homepage under following URL http://veritasblog.de/artikel/
    You will see, that the pencil icon, calendar icon etc. looks very strange. Instead there are some unknown icons/signs. Anyone know how to fix this ?

    #1398163
    Nabeel A
    Moderator

    Hi again,

    Please add the following code in your child theme’s style.css file:

    .x-icon-pencil:before {
        content: '\f040' !important;
    }
    .x-icon-calendar:before {
        content: '\f073' !important;
    }
    .x-icon-bookmark:before {
        content: '\f02e' !important;
        color: #7e7c7c;
    }
    .x-icon-comments:before {
        content: '\f075' !important;
        color: #7e7c7c;
    }

    Let us know how this goes!

    #1399025
    ili333
    Participant

    Thank you works fine, I added this code inside the Custom CSS. In child themes css this code doesn´t work.
    Now only the recent posts issue is left.

    #1399095
    Lely
    Moderator

    Hi There,

    Just to make sure, can you try disabling all plugins except cornerstone and then switch to main X theme? If your hosting has caching service, try clearing cache before checking again. This is just narrow down where that Read text is coming from.

    #1399696
    ili333
    Participant

    Hi, did it like you suggested, but that didn´t work

    #1400085
    Rad
    Moderator

    Hi there,

    Before we continue, because there are seems a confusion of what’s need to implemented.

    The changes you wish to implement is both for Home’s recent post element and Blog’s recent posts.

    Hence, you’re not going to remove any code, please re-add this code as this is for blog’s recent posts.

    if ( ! function_exists( 'x_excerpt_string' ) ) :
      function x_excerpt_string( $more ) {
        
        $stack = x_get_stack();
    
        if ( $stack == 'integrity' ) {
          return ' ... <div><a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a></div>';
        } else if ( $stack == 'renew' ) {
           return ' ... <div><a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a></div>';
        } else if ( $stack == 'icon' ) {
          return ' ...';
        } else if ( $stack == 'ethos' ) {
          return ' ...';
        }
    
      }
      add_filter( 'excerpt_more', 'x_excerpt_string' );
    endif;

    And this one is for home’s recent post element.

    // =============================================================================
    // Custom Excerpt Length - Call: echo excerpt($length);
    // =============================================================================
    
    function limited_excerpt($limit) {
       $excerpt = explode(' ', get_the_excerpt(), $limit);
       if (count($excerpt)>=$limit) {
          array_pop($excerpt);
          $excerpt = implode(" ",$excerpt).'.';
       } else {
          $excerpt = implode(" ",$excerpt);
       } 
       // $excerpt = preg_replace('<code>\[[^\]]*\]</code>','',$excerpt);
       return $excerpt;
    }
    
    // =============================================================================
    // Add Excerpt to Recent Posts
    // =============================================================================
    function x_shortcode_recent_posts_v2code( $atts ) {
      extract( shortcode_atts( array(
        'id'          => '',
        'class'       => '',
        'style'       => '',
        'type'        => 'post',
        'count'       => '',
        'category'    => '',
        'enable_excerpt' => 'true',
        'offset'      => '',
        'orientation' => '',
        'no_image'    => '',
        'fade'        => ''
      ), $atts, 'x_recent_posts' ) );
    
      $allowed_post_types = apply_filters( 'cs_recent_posts_post_types', array( 'post' => 'post' ) );
      $type = ( isset( $allowed_post_types[$type] ) ) ? $allowed_post_types[$type] : 'post';
    
      $id            = ( $id          != ''          ) ? 'id="' . esc_attr( $id ) . '"' : '';
      $class         = ( $class       != ''          ) ? 'x-recent-posts cf ' . esc_attr( $class ) : 'x-recent-posts cf';
      $style         = ( $style       != ''          ) ? 'style="' . $style . '"' : '';
      $count         = ( $count       != ''          ) ? $count : 3;
      $category      = ( $category    != ''          ) ? $category : '';
      $category_type = ( $type        == 'post'      ) ? 'category_name' : 'portfolio-category';
      $offset        = ( $offset      != ''          ) ? $offset : 0;
      $orientation   = ( $orientation != ''          ) ? ' ' . $orientation : ' horizontal';
      $no_image      = ( $no_image    == 'true'      ) ? $no_image : '';
      $fade          = ( $fade        == 'true'      ) ? $fade : 'false';
      $enable_excerpt = ( $enable_excerpt == 'true'      ) ? true : false;
    
      $js_params = array(
        'fade' => ( $fade == 'true' )
      );
    
      $data = cs_generate_data_attributes( 'recent_posts', $js_params );
    
      $output = "<div {$id} class=\"{$class}{$orientation}\" {$style} {$data} data-fade=\"{$fade}\" >";
    
        $q = new WP_Query( array(
          'orderby'          => 'date',
          'post_type'        => "{$type}",
          'posts_per_page'   => "{$count}",
          'offset'           => "{$offset}",
          "{$category_type}" => "{$category}"
        ) );
    
        if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();
          $content_excerpt = get_the_excerpt();
          $post_author     = get_the_author();
          if ( $no_image == 'true' ) {
            $image_output       = '';
            $image_output_class = 'no-image';
          } else {
            $image              = wp_get_attachment_image_src( get_post_thumbnail_id(), 'entry-cropped' );
            $bg_image           = ( $image[0] != '' ) ? ' style="background-image: url(' . $image[0] . ');"' : '';
            $image_output       = '<div class="x-recent-posts-img"' . $bg_image . '></div>';
            $image_output_class = 'with-image';
          }
    
          $output .= '<a class="x-recent-post' . $count . ' ' . $image_output_class . '" href="' . get_permalink( get_the_ID() ) . '" title="' . esc_attr( sprintf( __( 'Permalink to: "%s"', csl18n() ), the_title_attribute( 'echo=0' ) ) ) . '">'
                     . '<article id="post-' . get_the_ID() . '" class="' . implode( ' ', get_post_class() ) . '">'
                       . '<div class="entry-wrap">'
                         . $image_output
                         . '<div class="x-recent-posts-content">'
                           . '<h3 class="h-recent-posts">' . get_the_title() . '</h3>'
                           . '<span class="x-recent-posts-date">by ' . $post_author.' | ' . get_the_date() . '</span>'
                            . ( $enable_excerpt ? '<span class="x-recent-posts-excerpt">' . strip_tags(limited_excerpt(35)) . '</span> <span class="x-btn x-btn-square x-btn-mini">read more</span>' : '' )
                         . '</div>'
                       . '</div>'
                     . '</article>'
                   . '</a>';
    
        endwhile; endif; wp_reset_postdata();
    
      $output .= '</div>';
    
      return $output;
    }
        
    add_action('wp_head', 'change_recent_posts_to_v2');
    
    function change_recent_posts_to_v2() {
      remove_shortcode( 'x_recent_posts' );
      add_shortcode( 'x_recent_posts', 'x_shortcode_recent_posts_v2code' );  
    }
    // =============================================================================
    // =============================================================================

    All you need to do is edit this line,

    function x_excerpt_string( $more ) {

    and change it into this

    function x_excerpt_string( $more ) {
    
    if ( !is_home() ) return "";

    To make sure that there is no “Read” text on home’s recent post element.

    Thanks.

    #1400312
    ili333
    Participant

    Absolutely genius! It works fine. Great support by the way!

    #1400372
    Paul R
    Moderator

    Thank you for your kind words. Have a nice day!

  • <script> jQuery(function($){ $("#no-reply-1390826 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>