Archived topic
Can I have a differen layout for search?
10 replies · Started by Florian on November 10, 2018
Hey,
I use your native grid view for my blog page, but it looks very ugly in the search functionality since I have much more pages than posts.
Is there a way to disable the grid for search and just show single results below each other?
Hi there,
This should help: https://docs.generatepress.com/article/using-columns-in-the-blog/#changing-the-number-of-columns
Let me know :)
I have problems applying this. Can you tell me where to put this code and what exactly to use for the whole search?
This should be the exact code:
add_filter( 'generate_blog_columns','lh_disable_search_columns' );
function lh_disable_search_columns( $columns ) {
if ( is_search() ) {
return false;
}
return $columns;
}
Adding PHP: https://docs.generatepress.com/article/adding-php/
Let me know :)
Thank you, works like a charm!
I feel like I have to tip you guys for all the help you provide. Do you have a donate option?
Hi there,
really glad you appreciate the support.
Donations are always welcome for supporting the development:
The only downside is now that I don't have a preview of the page content anymore. Is it possible to get results that show where exactly the searched keywords was found?
Hi there,
Something like this?: https://wordpress.org/plugins/highlight-search-terms/
Let me know :)
I will take a look at it asap, thank you.
With this plugin I have a weird mix of titles-only and content search results.
Is there a way to show only and all appearances of the actual word that was searched?
EDIT: Nevermind, I installed a different search plugin which works pretty well.
Awesome :)