Shortly:
- I've custom post type called 'produkty'
- Inside this CPT I've taxonomy called 'kategorie_produktow' with terms (list of product categories, like in normal posts) - each product has ONE category
- Inside this CPT I've custom field called 'produkt_nowosc' - it is used to describe the product as newest in offer
- I'm using a custom page template to display all CPT with 'product_new' set as 'tak' (yes)
To display posts describe above I'm using normal WP_Query():
$the_query = new WP_Query( array( 'post_type' => 'produkty', 'meta_key' => 'produkt_nowosc', 'meta_value' => 'tak', 'posts_per_page' => -1) ) ;
It works perfect for displaying all products, with every product category (taxonomy and term).
[product 1] [product 2] [product 3] [product 4]
Now I'd like to separate each CPT taxonomy, it's term and display posts with produkt_nowosc
set to tak
like this:
Post category 1
:
[product 1] [product 2] [product 3]
Post category 2
:
[product 4]
What type of query should I use?