0

I created a new menu item which only pulls posts categorized “Webinars” but when I visit the Webinar category page, only the first post excerpt gets a “Read More” button.

What do I have to do so that all post excerpts in this blog category get a “Read More” button?

  • 1
    What's the code generating that archive page? – cjbj Sep 21 '16 at 17:49
0

There are only 2 posts on that page, so there's not a lot to go on here, but it looks like there is not enough text to warrant a Read More button for the second post.

By default, WordPress has an excerpt length of 55 words (looks like that's in effect on your site). The second post isn't long enough to have an excerpt so the full post is shown.

You can change the number of words in the excerpt to something shorter. Add this code to your theme's functions.php file:

/**
 * Filter the except length to 20 words.
 *
 * @param int $length Excerpt length.
 * @return int (Maybe) modified excerpt length.
 */
function wpse240108_custom_excerpt_length( $length ) {
    return 20;
}
add_filter( 'excerpt_length', 'wpse240108_custom_excerpt_length', 999 );

Alternatively, you can add a <!--more--> tag within the content generate your own excerpt rather than relying on WordPress to generate the excerpt.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.