Site logo

Archived topic

How to see full post content on search results?

5 replies · Started by Deniz Akay on May 26, 2022

Viewing posts 1–6 of 6

Hello,

I think Generatepress shows excerpts on WP post search results right? I already switched on "Full Content" option on Blog customization settings but it only allows me to show full post content on archive and single pages.

Here is a sample search query with excerpts: https://www.altcoinnet.com/haber/bitcoin+btc

Every post has a link at the end which points to original content on a different website and it's generated with a shortcode. Somehow search results trim the text and do not show these links.

Is there a way to show full post content on search results?

Thx

Hi Deniz,

You can use a block element - content template to build a custom layout for the search results page.

The Dynamic Content block (with GP logo as its icon) allows you to choose show excerpt or full content.

Hi Ying,

Content templates really look great but I just want to keep it simple as possible an bypass this "trim" problem somehow.

Look, here in my category page everything looks fine with posts, you can see all outgoing links at the end of posts: https://www.altcoinnet.com/btc-bitcoin/

I just want to apply same to search results page. There should be a function to do that...

I see, try this PHP snippet:

add_filter( 'generate_show_excerpt', function($show_excerpt ) {
	if(is_search()) {
		$show_excerpt = false;
	}
	return $show_excerpt;
});

This was what I'm talking about! Thanks Ying

No problem :)

This archived topic is closed to new replies.