Display div if category has a specific parent

So effectively, I’m now able to set a parent category ID, and have all the products that exist in subcategories within that parent ID echo my desired content – definitely open to any suggestions or improvements here! I’m using this in a function, which is placing the ‘tt’ div on my target product pages in … Read more

Sort products by Sale price and stock status

Try this. I followed the WP_Query docs to build this. $args = [ ‘meta_query’ => [ ‘relation’ => ‘AND’, [ ‘_stock_status’ => [ ‘key’ => ‘_stock_status’, ‘compare’ => ‘EXISTS’, ], ‘_sale_price’ => [ ‘key’ => ‘_sale_price’, ‘compare’ => ‘EXISTS’, ], ‘_price’ => [ ‘key’ => ‘_price’, ‘compare’ => ‘EXISTS’, ] ] ], ‘orderby’ => [ … Read more