Am a newbie to wordpress and I would like to display custom post type which is has two custom taxonomies. I would like to group those posts in relation to those two taxonomies it belongs to. From the codex I came across “tax_query” and i have come up with something like this
$args = array( 'post_type' => 'ved', 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'ved_brand', 'field' => 'slug', 'terms' => array('stuv','hwam','metalfire') ), array( 'taxonomy' => 'ved_type', 'field' => 'slug', 'terms' => array('braskaminer','spisinsatser','oppna-spisar') ) ) ); $query = new WP_Query($args);
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
So how can I sought those custom posts using the code I have. My goal is to group them as shown in this image https://dl.dropboxusercontent.com/u/21316108/Screen%20Shot%202013-09-09%20at%206.51.43%20PM.png I will really appreciate if anyone can help me out
- The topic ‘Custom post type and custom taxonomies’ is closed to new replies.