Site logo

Archived topic

Disable excerpt on specific category page

9 replies · Started by Royal Rangers on November 22, 2019

Viewing posts 1–10 of 10

I need disable excerpt for specific category on category and archive page. I try this code but excerpt is disable everywhere.
For example: category archiv - I don´t need excerpt, category press - I Need excerpt
Same rules are for category home - all posts.

function replace_content( $output) {
if (is_category('184, 110, 107, 115, 181')) {
return '' ;
}
}
add_filter( 'get_the_excerpt', 'replace_content' );

Still doesn´t work.

Its works for one category. I need more category. I try this:
if ( is_category('184''107')) {
if ( is_category('184,107')) {
Doesn´t work.

Its works!
Is possible disable excerpt in archive tag page - tag archive page? And disable only post of category which have disable excerpt on category page.

is_category() is the condition for i am viewing an archive.
Use the in_category() function instead this should remove the excerpt from those posts regardless of whether they are in the Blog or any of the archives.

Its works! Thank you very much David.

Awesome - glad to be of help

This archived topic is closed to new replies.