[Resolved] Search results in three columns

Home Forums Support [Resolved] Search results in three columns

Home Forums Support Search results in three columns

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1841298
    BreoganGal

    Hi, I have done the two steps to put the search in three columns but it still keeps showing in one column. I have no cache, I don’t know what it can be. I have added the two pieces of code you commented on in the functions.php:

    add_filter( ‘generate_blog_get_column_count’,’tu_search_column_count’ );
    function tu_search_column_count( $count ) {
    if ( is_search() ) {
    return 33;
    }
    
    return $count;
    }
    add_filter( 'option_generate_blog_settings', 'lh_search_columns' );
    function lh_search_columns( $options ) {
        if ( is_search() ) {
      $options['column_layout'] = true;
        }
      
        return $options;
    }

    If you need I give you credentials to review it.

    #1841384
    Leo
    Staff
    Customer Support

    Hi there,

    Looks like the quotation marks are wrong on the first block of code.

    Try this instead:

    add_filter( 'generate_blog_get_column_count','tu_search_column_count' );
    function tu_search_column_count( $count ) {
        if ( is_search() ) {
            return 33;
        }
    
        return $count;
    }
    #1841887
    BreoganGal
    add_filter( 'generate_blog_get_column_count','tu_search_column_count' );
    function tu_search_column_count( $count ) {
        if ( is_search() ) {
            return 33;
        }
    
        return $count;
    }
    
    add_filter( 'option_generate_blog_settings', 'lh_search_columns' );
    function lh_search_columns( $options ) {
        if ( is_search() ) {
      $options['column_layout'] = true;
        }
      
        return $options;
    }

    This is the code of functions.php. still not working

    #1841953
    David
    Staff
    Customer Support

    Hi there,

    did you resolve the issue as i tested the site and the search returned 3 columns:

    2021-07-02_11-48-19

    #1846370
    BreoganGal

    With a category filter does not work

    #1846412
    David
    Staff
    Customer Support

    When that filter is applied it takes you to the ‘blog’ template which is set to 1 column.
    Unless you want to change the main blog to 3 columns you would need to check with the Plugin author to see if it can use AJAX to filter the template or allow you to choose the search results template.

    #1847485
    BreoganGal

    Ok, they have already solved it for me. But now I have the problem that the buy button does not appear in the search results. How can I insert it?

    #1847943
    Leo
    Staff
    Customer Support

    Can you open a new topic for the new question?

    I’ll mark this one as resolved.

    Thanks 🙂

    #1972530
    Junior Gong

    Hey guys

    I used the code suggested here to make sure that my search layout does not display columns. Unfortunately on tablet view the search results are still displayed in 2 columns, see here:

    https://www.cannabisanbauen.net/?s=faustregel

    Scr: https://www.dropbox.com/s/ggktr41vwn7p45j/Screenshot%202021-10-23%20at%2013.00.15.png?dl=0

    I am using the folling snippet below. How do I have to modify it so that the one column layout is also applied to tablet view?

    
    add_filter( 'generate_blog_get_column_count','tu_search_column_count' );
    function tu_search_column_count( $count ) {
        if ( is_search() ) {
            return 100;
        }
    
        return $count;
    }
    
    #1972617
    David
    Staff
    Customer Support

    Hi there,

    remove that snippet and try this instead:

    add_filter( 'option_generate_blog_settings', 'lh_custom_search_results_page_settings' );
    function lh_custom_search_results_page_settings( $options ) {
        if ( is_search() ) {
    	$options['column_layout'] = false;
        }
      
        return $options;
    }

    If you’re still having issues, please raise a new topic where you can share a link to your site ( in the Private Information field ) and we can take a look.

    #1972982
    Junior Gong

    Awesome, that works now! thx for the quick support!

    #1973173
    David
    Staff
    Customer Support

    Glad to be of help!

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