Tagged: x
-
AuthorPosts
-
August 13, 2016 at 4:11 pm #1130155
turnkeyflyers
ParticipantHi, 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,
August 14, 2016 at 12:08 am #1130459Christopher
ModeratorHi 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 / passwordDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thanks.
August 17, 2016 at 12:42 am #1134735turnkeyflyers
ParticipantThis reply has been marked as private.August 17, 2016 at 2:39 am #1134830Rupok
MemberHello 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.
August 17, 2016 at 6:46 pm #1135914turnkeyflyers
ParticipantThank 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/
August 18, 2016 at 1:08 am #1136334Rupok
MemberHi there,
Are you using custom excerpt for he posts? In that case make sure to have a bit more excerpt.
Thanks!
August 18, 2016 at 5:46 pm #1137576turnkeyflyers
ParticipantI don’t understand what that means, please explain. Thanks,
August 18, 2016 at 11:30 pm #1137925Lely
ModeratorHello 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.
August 19, 2016 at 4:46 pm #1138760turnkeyflyers
ParticipantIs there any way to use a button instead of a text link for Read More?
August 19, 2016 at 10:12 pm #1139109Rue Nel
ModeratorHello 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.
August 23, 2016 at 7:24 pm #1143895turnkeyflyers
ParticipantPerfect! Thank you,
August 23, 2016 at 9:58 pm #1144136Prasant Rai
ModeratorYou are most welcome. 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1130155 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>