• Resolved keneso

    (@keneso)


    Hi

    I am working with a custom child of Storefront theme, and would like to have both categories, and products to be displayed on the “shop” page; I do know that you can set that in the cusomization in the dashboard, but that displays/lists the categories as products, meaning in the same div, which is not good layout IMHO.

    I do see the loop is in archive-product.php which I copied, and put in the child theme, not being a coder I don’t know how to rewrite the loop to achieve separating categories from products in a layout as this

    <div class="categories-list">
    all the categories
    </div>
    <div class="products-list">
    all the products
    </div>

    As alternative I used the shortcode [product_categories columns=”3″] in the shop page, but I think maybe it would be better to have it in the loop?

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @keneso

    You’re correct in your understanding that the loop in the archive-product.php file is responsible for displaying both categories and products on the “shop” page. To achieve your desired layout, you will need to modify this loop.

    However, as you’ve mentioned that you’re not a coder, I would recommend using an alternative method that involves shortcodes. This can help you separate categories from products without modifying the PHP code.

    If you still wish to modify the loop in the PHP file, we recommend that you seek help from the following as it requires a good understanding of PHP and WordPress theme structure:

    I wish I could help more, but hopefully, this gets you going in the right direction to get the job done.

    Thread Starter keneso

    (@keneso)

    Thank you, I think I’ll go with the shortcode.

    Hi @keneso,

    Thank you, I think I’ll go with the shortcode.

    That sounds like a great decision. Using shortcodes can make the process much simpler and more manageable.

    I’ll go ahead and mark this thread as resolved. However, if you ever have more questions or issues in the future, don’t hesitate to kick off a new topic.

    Hope you have a fantastic day!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘separating product and categories loop’ is closed to new replies.