Archived topic
Infinite Category
7 replies · Started by Simone on June 13, 2022
Hi
When I scroll my posts in one of my categories, it shows the whole post. What can I do to make it expert like my other articles? Here is an example of what I mean: https://cruisingsea.com/category/yacht-reviews/
Hi Simone,
May you check the Post format of the Posts showing the full post in archive pages? By default, the excerpt and word count options only work for Standard post format.
Kindly let us know.
Hi Fernando,
Thank you for your reply. Should I put the code of the snippet? If so, can you please tell me where? Thank you
Hi there,
you have two options:
1. You can edit the Post(s) and change the Post Format from Video to Standard.
OR
2. You can add the PHP Snippet to your site.
This doc explains how to add the code:
https://docs.generatepress.com/article/adding-php/
TLDR: Are you using a Child Theme?
If Yes - add the code to the Child Theme > functions.php file
If No - install the Code Snippets plugin and add the code using a new snippet
Hi David,
Thank you. One more question, please. Which of these codes do I have to add to the child theme? And where exactly in the child theme?
Thanks again again
If you want to go with the 2nd option David suggested, you can add this code to your child theme's functions.php file.
add_filter( 'generate_show_excerpt', function( $show ) {
if ( 'standard' !== get_post_format() && ! $show ) {
return true;
}
return $show;
} );
Hi Ying, thank you!
No problem :)