How do I unset category from a product in wordpress by code

To remove all category from a WooCommerce product, you can use the wp_set_object_terms() function. Here is an example of how you can use wp_set_object_terms() to remove categories from a product: // Set the product’s categories to an empty array $categories = array(); wp_set_object_terms( $product->ID, $categories, ‘product_cat’ ); If you want to remove a specific category, … Read more

inner-wrap div pushing custom table far down on page

Part of the problem is that you’re running (or re-running) get_header() after your table, thus putting all of the header content into the body of page after the table HTML has started. <?php /* Template Name: Custom Table Is this part even needed for you? If this is a complete template, then probably, but if … Read more