Archived topic
How to disable excerpts completely
5 replies · Started by oge on December 24, 2019
Hi
I have an aggregated news website with feeds being pulled in by WP RSS Aggregator.
How do I disable excerpts completely in GP?
How do I disable excerpts on certain category pages?
Thanks
Hi there,
You can set the excerpt length in Customize > Layout > Blog to 0 to remove excerpts completely. Then you can hide the containing element like this:
.entry-summary {
display: none;
}
To target specific categories, you can do this instead:
add_filter( 'excerpt_length', function( $length ) {
$categories = array(
'one-category',
'another-category',
'one-more',
);
if ( is_category( $categories ) ) {
$length = 0;
}
return $length;
}, 200 );
Hope this helps :)
Hi tom, I try to follow this. But there is gap (I dont know how name it) likes more padding.
Did you use the CSS as well?
For example:
.category-one-category .entry-summary,
.category-another-category .entry-summary,
.category-one-more .entry-summary {
display: none;
}
Niche I never regret buying generatepress.
It done by resizing all featured image at same size.
Glad you got it working :)