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’ );
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.