Thanks for getting back to me.
I’m actually not using a plugin to display products on the home page (and yes, I have set the site’s homepage to ‘Home’). I’m using the theme’s option to place widget area below the header to which, I’ve added 2 Woocommerce widgets. The first holds the latest posts and the second holds a display of the newest products.
The widget container for the latest posts renders in HTML as:
<div id=”block-3″ class=”widget widget_block widget_recent_entries”>
The widget container for the newest products renders in HTML as:
<div id=”block-6″ class=”widget widget_block”><div data-block-name=”woocommerce/product-new” data-columns=”4″ class=”wc-block-grid wp-block-product-new wc-block-product-new has-4-columns has-multiple-rows”>
Now this renders as I want it on the home page which has a body CSS class of “home page-template”.
When I click on a single product on the home page the body CSS class changes to “product-template-default”, but the widgets below the header still render on this page.
I only want these widgets to display on the home page – not any other product pages. Obviously, I can add a ‘display: none’ rule on the widgets for every class of page I don’t want them to appear, but surely there is something I can do in my child theme to do this?
When a site visitor clicks on one of the newest products on the home page, a good theme design should allow the visitor to immediately click through to the product page without any other clutter on the product page. If the widgets below the header are always set to render on every page without any way of setting them to specific pages, then the UI becomes very user-unfriendly, especially on mobile screens where screen-space is premium.
Using CSS to hide widgets is not ideal in 2021! The theme should give more control over the pages they render on.