Archived topic
Search Results Page
7 replies · Started by Alan on November 16, 2020
For my staging site, I want to control the output of the search results page. This is a combination of blog posts, pages, and a custom post type (tours). In the search results page example shown, https://savacaystage.wpengine.com/?s=quito, I just want the titles shown, without the author name, duration, or except. So for example, the titles would be only "Ten Things To Do In Quito, Ecuador", "Quito and 7 Day Santa Cruz II Cruise – Eastern Galapagos Islands", etc.
How can I do this in GP/GP Premium?
Please let me know.
Thanks,
Hi,
To clarify: You want the entry-meta items removed on search results but keep in archive pages?
Yes, I only want the entry-meta items removed from the search page.
Try this PHP snippet:
add_action( 'wp', function() {
if ( is_search() ) {
remove_action( 'generate_after_entry_content', 'generate_footer_meta' );
remove_action( 'generate_after_entry_title', 'generate_post_meta' );
}
} );
Here's how to add PHP - https://docs.generatepress.com/article/adding-php/
That removed the byline. I also want to remove the "tour-meta", which is "10 Days/9 Nights from $6,019", and the "tour-meta" paragraph, which is "Venture to Quito and the eastern Galapagos Islands on this fascinating Ecuador tour. In Quito, you will enjoy a city tour and visit to the…"
Thanks,
Try this CSS:
body.search .entry-summary {
display: none;
}
That worked. Thank you.
That worked. Thank you.
No problem. Glad to be of any help. :)