Excerpt length and "read more" link on category archive page?

I have a couple of blog categories, and I’ve added those categories to my main nav so that I can display a list of articles that fall under the category of “news,” for example.

When I view these category archive pages, I notice a couple of problems. First of all, there is no “read more” link. How can I add that?

Also, the length of the excerpt does not match where I add the “more” line break when writing the article in the admin panel. It seems that the excerpt length is set automatically somewhere, and I cannot change it.

Here is a link to one of the pages: http://illusionpodcast.com/category/episodes/

In my settings, under Options > Blog, I have “full post content on index” disabled. But I’ve tried enabling it and that makes no difference.

So to recap, I’m looking for a way to add a “read more” link to the excerpts on my category archive pages and also control the length of those excerpts.

Thank you!

Hello There,

Thanks for writing in! To add a read more in your excerpts in the archive pages, since the child theme is set up, please add the following code in your child theme’s functions.php file

// Ethos custom read more
// =============================================================================

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;
// =============================================================================

We would loved to know if this has work for you. Thank you.

Thanks! I just tried this, and it did nothing. I added it under the “additional functions” line in my child theme’s functions file. All of the excerpts look exactly the same.

Hi,

I tried the code provided in my test sites and it seems to work.

Would you mind providing us your wordpress admin login in Secure Note so we can take a closer look.

Thanks

Can I have the code to do the same with the Integrity stack please?

I have tried the @ruenel code with no result.

Hey Philippe,

I just tested the code here and still works and it’s for all stacks. You just need to edit what the stack condition will return. Because it works, there’s nothing more we can show you for this case.

image

I’d like to apologize if your expectation was not handled here. Ruenel should not have provided custom code without clarifying that it’s only a guide and that theme customization is outside the scope of our support. All custom codes provided here, in our forum. Custom codes serve only as a starting point for coders. That means you must be able to work out the modification you need from the sample code. We do not support issues that arise from them nor will we enhance them. With that said, you need to consult with a 3rd party developer to fix the custom code.

If hiring a developer is not feasible for you, I’d recommend using one of the bundled grid plugins. Both plugins are customizable like adding a Read More link to post items and that’s without the use of custom code. Please visit the links below for more details and plugin usage instructions.

Hope that helps and thank you for understanding.

Hi Christian. My point of view in that his is a theme design issue. The global design should be the same everywhere in any archive page… If Read more… is there in post archive page it should be in the post tag archive too and the fix should be provided by Themeco support. And fixed in the next release.

Hello Philippe,

The code I gave in the previous response should still work. Just be advised that if you are using the Custom or Manual Excerpts, the read more link will no longer display. If you also have other PHP codes modifying the excerpt, then there might be a conflict which is why the code did not work for your case.

If you need anything else we can help you with, don’t hesitate to open another thread.

Regards,
RueNel

I have the same problem using pro/icon.
Archive pages from the theme have no read more (link/button)
https://kunsteiland.nl/kunstenaars-category/2019/
Archive pages from WPbakery masonry do have the read more (link/button)
https://kunsteiland.nl/archief/

Added the above code into the Child functions but still no link. (Or was this only for ‘X’?)

Hey @Westervoort,

Since this is an old thread and to avoid any confusion. I suggest that you create your own ticket and that newly created ticket, please give us the following information in a Secure Note.

  • WordPress Login URL
  • Admin level username and password

You can find the Secure Note button at the bottom of your posts.

Thank you.