Read More button for Blog Posts in PRO

Currently for blog posts there is only the option to click the image or title, my client wants a Read More button. I see how to do this for the old theme, how do I accomplish this in Pro?

It would also be nice to have a “…” at the end of the paragraph where the excerpt length.

Additionally, is there a way to limit the amount of “recent posts”?

Thanks!

Hello There,

Thanks for writing in!

1.) For each stack, they have different settings. Some may have read more, other stacks only have .... I am not which stack are you using. To make sure that all stacks has a read more, assuming that you child theme is installed is active, you can simply add this code in your child theme’s functions.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 ' ... <a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a>';
    } else if ( $stack == 'ethos' ) {
      return ' ... <a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a>';
    }

  }
  add_filter( 'excerpt_more', 'x_excerpt_string' );
endif;

And to limit the number of recent post items, you can go to Settings > Reading > Blog pages show at most. The WordPress default is just 10.

Hope this helps. Please let us know how it goes.

Thanks! I am using “Integrity”…and I see the code should be working, but it doesn’t seem to be. See the image below…There is no “Read More” or “…”

I have added access in the Secure Note if you need it.

Hi There,

I have created a test page and selected it as blog from Settings -> Reading section.

Then I have added the following code into your child theme.

//Read More Button For Excerpt
function themeco_read_more_link($output) {
    global $post;
    return empty( $output ) ? $output : $output . "..." . ' <a href="' . get_permalink($post->ID) . '" class="more-link" title="Read More">Read More</a>';
}
add_filter( 'the_excerpt', 'themeco_read_more_link' );

Let us know if that helps.
Thanks!

Perfect! Thank you!

You are always welcome.

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.