Only display the section if the shortcode returns products – not working
-
I want to hide “Recent Products” if (and this is the case now) no one is there.
The strange thing is that there should be functionality for this in WooCommerce.
In the file:wp-content/themes/storefront/inc/woocommerce/storefront-woocommerce-template-functions.php
and the function
storefront_recent_products
It says in a comment: “Only display the section if the shortcode returns products”
It comes from:
$ shortcode_content = storefront_do_shortcode (
‘products’, apply_filters (
‘storefront_recent_products_shortcode_args’, array (
‘orderby’ => esc_attr ($ args [‘orderby’]),
‘order’ => esc_attr ($ args [‘order’]),
‘per_page’ => intval ($ args [‘limit’]),
‘columns’ => intval ($ args [‘columns’]),
)
)
);As declared in
/wp-content/themes/storefront/inc/storefront-functions.php
Is it because the setting for (showing) stock is to not show those out of stock?
Greetings A.V.E
The page I need help with: [log in to see the link]
- The topic ‘Only display the section if the shortcode returns products – not working’ is closed to new replies.