Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1149638
    yhshin1020
    Participant

    Hey,

    I am running Integrity.

    How do I add a “read more” link to the blog excerpt?

    I’ve read other threads on the same question but the response seems to vary from thread to thread so I might as well open up a new one.

    Thanks.

    #1149639
    yhshin1020
    Participant
    This reply has been marked as private.
    #1149754
    Lely
    Moderator

    Hello There,

    Please add the following code on your child theme’s functions.php file:

    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 ' ...';
        } else if ( $stack == 'icon' ) {
          return ' ...';
        } else if ( $stack == 'ethos' ) {
          return ' ...';
        }
    
      }
      add_filter( 'excerpt_more', 'x_excerpt_string' );
    endif;

    Hope this helps.

    #1149761
    yhshin1020
    Participant
    This reply has been marked as private.
    #1149973
    Rad
    Moderator

    Hi there,

    Please add this as well,

    add_filter('the_excerpt', 'add_read_more', 99999);
    
    function add_read_more ( $excerpt ) {
    
    global $post;
    
    return $excerpt. ( empty( $post->post_excerpt ) ? '' :  ' ... <div><a href="' . get_permalink() . '" class="more-link">' . __( 'Read more', '__x__' ) . '</a></div>' );
    
    }

    Manually added excerpt doesn’t have read more, but we can add it this way by checking it’s excerpt generated by WordPress or just manually added text.

    Hope this helps.

    #1150133
    yhshin1020
    Participant
    This reply has been marked as private.
    #1150217
    Lely
    Moderator

    Hi There,

    I did check again and it seems the code is added properly. This might be cache content? But then you don’t have caching plugin. Can you check in with your hosting provider and ask if they are running a caching service? If yes, ask to delete/purge site cache. Do let us know how this goes.

    #1150227
    yhshin1020
    Participant
    This reply has been marked as private.
    #1150245
    Rue Nel
    Moderator

    Hello There,

    Caching helps load your page fasting. Most of the time, any changes won’t take effect because the page if already cached. This can cause the changes to not take place on the front end. This is the time that you need to delete or clear the cache. It will eventually show up when the cache regenerates, but it’s not ideal if you’re looking to see your changes immediately. Caching plugins are best to turn on only when you’ve finished building the site.

    Hope this make sense.

    #1150543
    yhshin1020
    Participant

    This is the time that you need to delete or clear the cache. It will eventually show up when the cache regenerates, but it’s not ideal if you’re looking to see your changes immediately.

    So are you saying that i need to wait to see the changes happen? I don’t mind, but I’m still not seeing any changes. I’m afraid to turn off caching: does that mean the website wont allow for future caching?

    Thank you.

    #1150574
    Rupok
    Member

    Hi there,

    When you are developing the site or changing the content often you should disable cache because the new content/changes won’t be visible to your site. When you are done with changes and your site is quite stable; you should enable caching then.

    Thanks!

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