Tagged: x
-
AuthorPosts
-
August 27, 2016 at 9:06 am #1149638
yhshin1020ParticipantHey,
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.
August 27, 2016 at 9:06 am #1149639
yhshin1020ParticipantThis reply has been marked as private.August 27, 2016 at 11:21 am #1149754
LelyModeratorHello 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.
August 27, 2016 at 11:31 am #1149761
yhshin1020ParticipantThis reply has been marked as private.August 27, 2016 at 7:01 pm #1149973
RadModeratorHi 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.
August 27, 2016 at 10:07 pm #1150133
yhshin1020ParticipantThis reply has been marked as private.August 28, 2016 at 1:05 am #1150217
LelyModeratorHi 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.
August 28, 2016 at 1:11 am #1150227
yhshin1020ParticipantThis reply has been marked as private.August 28, 2016 at 1:49 am #1150245
Rue NelModeratorHello 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.
August 28, 2016 at 9:56 am #1150543
yhshin1020ParticipantThis 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.
August 28, 2016 at 10:27 am #1150574
RupokMemberHi 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!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1149638 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
