Support » Theme: Storefront » Storefront display homepage products by categories

  • First i want to say thanks for this great theme!

    I need to display the products in homepage by categories.
    Example: display the title of “kitchen” and then show 4 products of this specific category. how can i do that?

    website: http://www.brandisnow.com

    • This topic was modified 6 years, 9 months ago by roeecohen.
    • This topic was modified 6 years, 9 months ago by roeecohen.
    • This topic was modified 6 years, 9 months ago by roeecohen.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hi @roeecohen,

    That’s great to hear you are enjoying using Storefront 🙂

    For the particular layout, you describe it’s not one that is available by default within storefront to list products by specific categories.

    With the way Storefront has been developed however you could add these areas by creating some custom code to display the WooCommerce shortcode for Product Category for each individual category you wish to display on the homepage template.

    https://docs.woocommerce.com/document/woocommerce-shortcodes/#section-12

    Below is an example of the code you would require to display this and you would need to duplicate the code for each category you wish to display. You also need to change the sf_output_custom_shortcode_section function name for each new instance you were to add.

    You will also need to change the category from music in my example below to your own category which you wish to display too. 😉

    https://gist.github.com/stuartduff/843e61cacb4cb85eb84f

    You can add this code to a child themes functions.php file and if you need a blank starter child theme you can use this one below.

    https://github.com/stuartduff/storefront-child-theme

    Also if at first the new areas which you add not show up install Homepage Control as the sections will be deactivated by default and you can activate them and reorder them using this plugin.

    https://wordpress.org/plugins/homepage-control/

    I hope this helps.

    Thread Starter roeecohen

    (@roeecohen)

    Thanks for the reply!

    i didnt understand what should i add instead off the “sf_output_custom_shortcode_section”
    Here examples for products ids: 1251, 1262, 1245 , 1226, 1278.
    Thanks!

    Thread Starter roeecohen

    (@roeecohen)

    Oh i got this! Thank you very much!

    Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hey @roeecohen that’s great to hear you got this now 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Storefront display homepage products by categories’ is closed to new replies.