• Resolved gmsiegel

    (@gmsiegel)


    I’m trying to show more than 3 categories per row on my home page. This appears in the section of the Homepage Control called “Storefront Product Categories”.

    It DOES show 4 Categories per row on my Shop page (https://www.reddirtoutlet.com/shop/), and this is how I’d like the “Storefront Product Categories” section to appear on my home page. I’m using a child theme of the WooCommerce Storefront theme, so adding code to the functions.php and/or custom CSS would be fine.

    Web site: https://www.reddirtoutlet.com/

    Many thanks in advance!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Job a11n

    (@jobthomas)

    Automattic Happiness Engineer

    Hi @gmsiegel, this is the reference section of the filters you need: https://docs.woocommerce.com/document/storefront-hooks-actions-filters/#homepage

    Thread Starter gmsiegel

    (@gmsiegel)

    Thanks Job. I was able to copy that specific function code into my custom functions file.

    This function is located in the file:
    /wp-content/themes/storefront/inc/storefront-template-functions.php

    The function is called ‘storefront_product_categories’

    Hi @gmsiegel.

    I too want to have more than 3 categories per row on my home page. I do not have any coding background and could not understand the process you mentioned in your response. Can you please explain the steps needed to change the number of categories.

    Thanks for your help in advance !

    Thread Starter gmsiegel

    (@gmsiegel)

    aktatineni-

    The solution involves editing your functions.php file. See this link for more info about what’s involved with that (and of course, be sure to backup the file before editing it):
    https://www.converticacommerce.com/support-maintenance/how-to-edit-functions-php-in-wordpress/

    Good luck!

    For a specific example, I changed my home page to show 4 categories in 4 columns by adding the following to the theme’s functions.php:

    add_filter('storefront_product_categories_shortcode_args','custom_storefront_category_per_page' );
     
    // Category Products
    function custom_storefront_category_per_page( $args ) {
     $args['number'] = 4;
     $args['columns'] = 4;
     return $args;
    }

    As a side note, I can’t understand why such a simple change isn’t available in the theme settings, rather than having to do it this way. Bizarre!

    Just installed StoreFront, nice stuff but..

    Why should you need to dig into the code to change the number of product
    categories in the home page? it should be a setting in the customizer.

    I saw a plugin for increasing the number of products per row,
    But is there a plugin to change the number of product categories per row?

    I guess I’ll need to find a child-theme next, to do this functions.php edit.

    I’ve created an issue in the Storefront issue queue for this:

    https://github.com/woocommerce/storefront/issues/943

    Any comments on this issue should be posted there so the development team see them.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Show more than 3 Categories on Homepage Control Storefront Product Categories’ is closed to new replies.