Site logo

Archived topic

Showing automatic excerpt on the wp-show-posts list

28 replies · Started by Hasan on June 10, 2019

Viewing posts 16–29 of 29

You can set the excerpt to 0 in the Customizer > Layout > Blog
WP Show Posts has its own control for the excerpt.
Or what am i missing?

Aah - only Auto Excerpts can be limited in length by the customizer.
May i ask why the manual excerpt if you're not going to display it?

In the show post list here, I've set the excerpt length from the show posts settings to 70 word, which shows the full paragraph when I have small text on any post.

But if the post is with long text, it shows exactly 70 words and shows "..." in the end, combining the paragraphs and removing the gap between the paragraphs, which does not look good. On this case, if I provide a manual excerpt, it shows one full paragraph nicely, hence the necessity of using manual excerpt for the long posts.

Will appreciate any idea to stop it being generated on the archive pages.

I don't believe there is a way to overwrite manual excerpt as that kind of defeats the purpose as David mentioned.

If it's just for one post maybe we can try CSS to hide it?

Can you link me to the page in question and direct me to the post?

Unfortunately I don't believe there is a way to go around it without some custom solution.

Custom excerpt (a WordPress core function) is meant to be displayed when used.

You could try asking WordPress' support to see if they have any workaround solution or a forum like this:
https://stackoverflow.com/

/*
	Remove excerpts from the achrive pages only
*/

add_filter( 'wp_trim_excerpt', 'db_excerpt_metabox_remove' );
function db_excerpt_metabox_remove( $excerpt ) {
	$output = $excerpt;
	
	if ( is_archive() && has_excerpt() ) {
		$output = '';
	}
	
	return $output;
}

Got this code from an old support thread, which should remove the manual excerpt from the archive pages. Any idea why this does not work?

Modified the code as the follows, and it resolved the issue - if it helps someone else in future:

/*
	Remove excerpts from the achrive pages only
*/

add_filter( 'wp_trim_excerpt', 'db_excerpt_metabox_remove' );
function db_excerpt_metabox_remove( $excerpt ) {
	$output = $excerpt;
	
	if ( is_archive() && has_excerpt() ) {
		$output = '';
	} elseif ( is_home() && has_excerpt() ) {
		$output = '';
	}
	
	return $output;
}

Thanks Leo for pointing toward this! Apparently it was not impossible to do.

Thank you so much David for going above and beyond to resolve this issue! I've experience of working with support of several top selling themes, but I can honestly say, from you I've received the best theme support ever! Kudos!! :)

No problem!

This archived topic is closed to new replies.