Site logo

[Resolved] How to style the search results page to match other archive layouts?

Home Forums Support [Resolved] How to style the search results page to match other archive layouts?

Home Forums Support How to style the search results page to match other archive layouts?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2373882
    Sasha

    Hi there,

    My search results page uses the same content template as my archive pages, but the posts don’t appear in masonry columns as they do on the archives.

    How can I make the search results page consistent with the archives?

    Thanks!

    #2373967
    Ying
    Staff
    Customer Support

    Hi Sasha,

    You can use this snippet to enable columns for search:

    add_filter( 'generate_blog_columns', function( $columns ) {
        if ( is_search() ) {
            return true;
        }
    
        return $columns;
    } );

    And this to add masonry:

    add_filter( 'generate_blog_masonry','tu_portfolio_masonry' );
    function tu_portfolio_masonry( $masonry ) {
        if ( is_search()) {
            return 'true';
        }
    
        return $masonry;
    }
    #2374158
    Sasha

    Another flawless solution – thanks Ying!

    #2375524
    Ying
    Staff
    Customer Support

    You are welcome 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.