Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1130155

    turnkeyflyers
    Participant

    Hi, I would like my blog posts to have a Read More button at the end of each blog post preview on this page: https://www.turnkeyflyers.com/blog

    Currently, the read more link is missing. Thanks,

    #1130459

    Christopher
    Moderator

    Hi there,

    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

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

    Thanks.

    #1134735

    turnkeyflyers
    Participant
    This reply has been marked as private.
    #1134830

    Rupok
    Member

    Hello There,

    Thanks for writing back!

    Because this requires a template change, I’d advise that you setup a Child Theme. This allows you to make code changes that won’t be overwritten when an X update is released.

    Then add following code in Child Theme function.php file.

    // Excerpt More String
    // =============================================================================
    
    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 ' ... <a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a>';
        } else if ( $stack == 'icon' ) {
          return ' ...';
        } else if ( $stack == 'ethos' ) {
           return ' ... <a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a>';
    
        }
    
      }
      add_filter( 'excerpt_more', 'x_excerpt_string' );
    endif;

    Let us know how it goes.

    Thanks.

    #1135914

    turnkeyflyers
    Participant

    Thank you. I have added the code to child theme but the Read More only shows up on some of the blog posts, even though there is more text for those posts. https://www.turnkeyflyers.com/blog/

    #1136334

    Rupok
    Member

    Hi there,

    Are you using custom excerpt for he posts? In that case make sure to have a bit more excerpt.

    Thanks!

    #1137576

    turnkeyflyers
    Participant

    I don’t understand what that means, please explain. Thanks,

    #1137925

    Lely
    Moderator

    Hello There,

    I did check and you’re using custom excerpts. This is when you clicl Screen Option at the upper right part of the page and click Excerpt. Then you add manual excerpt on the text field at the bottom. Since you’re not using manual excerpt, and you have added above code already, we might be seeing cache content. Please try to delete/purge cache and then check again.

    Hope this helps.

    #1138760

    turnkeyflyers
    Participant

    Is there any way to use a button instead of a text link for Read More?

    #1139109

    Rue Nel
    Moderator

    Hello There,

    If you want to display a button, please update the code given by @rupok in the previous reply. You can make use of this code instead:

    // Excerpt More String
    // =============================================================================
    
    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="x-btn x-btn-mini x-btn-flat more-link">' . __( 'Read More', '__x__' ) . '</a></div>';
        } else if ( $stack == 'renew' ) {
          return ' ... <a href="' . get_permalink() . '" class="x-btn x-btn-mini x-btn-flat more-link">' . __( 'Read More', '__x__' ) . '</a>';
        } else if ( $stack == 'icon' ) {
          return ' ...';
        } else if ( $stack == 'ethos' ) {
           return ' ... <a href="' . get_permalink() . '" class="x-btn x-btn-mini x-btn-flat more-link">' . __( 'Read More', '__x__' ) . '</a>';
    
        }
    
      }
      add_filter( 'excerpt_more', 'x_excerpt_string' );
    endif;

    The code above is using a mini flat button. If you want something else please let us know.

    Cheers.

    #1143895

    turnkeyflyers
    Participant

    Perfect! Thank you,

    #1144136

    Prasant Rai
    Moderator

    You are most welcome. 🙂