Site logo

Archived topic

Can I have a differen layout for search?

10 replies · Started by Florian on November 10, 2018

Viewing posts 1–11 of 11

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?

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?

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?

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 :)

This archived topic is closed to new replies.