How to Delete all Unused photos Function

As a rule, I suggest you try to stick as much as possible to WordPress core functions when modifying the database, as they will handle associated data automatically – e.g. delete associated post meta, associated taxonomy info, etc. (Woocommerce stores product image data as product post_meta, see below for details.) This might slow things down … Read more

Hiding posts – WP Hide Post not working

here is a code example to hide post. However you need to use a custom meta for this to work. So, add a new meta with the post you want to hide. Use meta key name as ‘hidethis’ and use value ‘1’. Don’t use the quote marks, just the texts. Next this is to add … Read more

(WooCommerce) Remove Sidebar only on Single-Product page

The conditional tag for single products is is_product() add_action(‘template_redirect’, ‘remove_sidebar_shop’); function remove_sidebar_shop() { if ( is_product(‘add-page-i.d-here’) ) { remove_action(‘woocommerce_sidebar’, ‘woocommerce_get_sidebar’); } } You may also want to change the layout on that product page to full width to remove the gap and reduce the width of the content area using a custom body class which … Read more