Tagged: x
-
AuthorPosts
-
February 22, 2017 at 7:44 pm #1382157
coreygoodieParticipantHi there,
On my blog, http://www.goodiesgutguide.com/category/scd-recipes/, I’d like to use both a “more” command to control the excerpt/preview text shown on the blog page, but also show a “Read More” button.
As you can see on this page here http://www.goodiesgutguide.com/scd-legal-mayo/ I added the MORE tag, and the excerpt is displaying correctly, but there is no Read More button being displayed.
Thanks.
February 22, 2017 at 7:44 pm #1382158
coreygoodieParticipantThis reply has been marked as private.February 23, 2017 at 12:39 am #1382474
Rue NelModeratorHello There,
Thanks for writing in! The read more will only display if your excerpts is more than the automatic excerpts dynamically generated for the post. Since you have added a more tag, the read more will no longer display since the excerpt/preview text is considered before the more tag in your post.
Because what you are trying to accomplish requires a template customization, we would like to suggest that you use a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
To customize this and make sure that read more will also appear, please insert this following code in your child theme’s functions.php file.
// Custom 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 ' '; } else if ( $stack == 'icon' ) { return ' ...'; } else if ( $stack == 'ethos' ) { return ' ...'; } } add_filter( 'excerpt_more', 'x_excerpt_string' ); endif; // ============================================================================= // Add Custom read more // ============================================================================= function add_custom_read_more( $query ) { echo '<p><a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a></p>'; } //add_action( 'x_after_view_global__content-the-excerpt', 'add_custom_read_more' ); // =============================================================================We would loved to know if this has work for you. Thank you.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1382157 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
