[Support request] Woocommerce Search Results Page – Change number of columns

Home Forums Support Woocommerce Search Results Page – Change number of columns

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1356418
    Sarah

    Hi,

    I have some custom code in funtions.php that makes the main shop page only display 2 columns.

    function my_custom_css() {
         if (function_exists('is_shop') && is_shop()) {
            echo "<style type='text/css'>.woocommerce .wc-columns-container.wc-columns-4 .products{grid-template-columns: repeat(2,minmax(0,1fr));}</style>";
        }
    }
    add_action('wp_head', 'my_custom_css' );

    I am also using WOOF product filter which basically displays results (based on filters) on the ‘main’ shop page. I want these results to be displayed in 4 columns, but obviously the code forcing the shop to display 2 columns is affecting this. Is there a way I can separate the two?

    https://eb-motorsport.com/shop/
    https://eb-motorsport.com/shop/?swoof=1&pa_model=911-1965&pa_parts=bodywork

    #1356864
    Leo
    Staff
    Customer Support

    Hi there,

    I’m not sure where that code is coming from – it’s not something from the theme.

    If it’s the default WooCommerce shop page then there is a customizer option for that:
    https://docs.generatepress.com/article/woocommerce-overview/#shop

    #1357616
    Sarah

    Hi,
    Sorry, I don’t think you understood my question, I’ve entered the code in fuctions.php so that the main shop page displays 2 columns.

    The customizer option only allows me to change the number of columns on all Woocommerce pages. I want to specify which types of Woocommerce pages show different amounts of columns. So I want the main shop page to show 2 columns, but the product search results page to show 4 columns.

    Could you get this escalated to the developer, please?

    #1358152
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Any chance you can remove the coming soon page so I can take a look?

    Let me know 🙂

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