Display Posts from Custom Post type by Taxonomy
-
According to the codex, this code should allow me to use the loop to call a list of posts from a specific post type and taxonomy:
<?php $args = array( 'post_type'=> 'family', 'cult' => 'caaleni', ); query_posts( $args ); ?>When I navigate to the page where this code is, I just get all of the posts from the post-type “family” instead of “family” posts from Caaleni (which is part of the ‘Cult’ taxonomy).
This is the code used to create the taxonomy:
register_taxonomy('cult',array ( 0 => 'family', ),array( 'hierarchical' => true, 'label' => 'Cult','show_ui' => true,'query_var' => true,'rewrite' => array('slug' => 'cult'),'singular_label' => 'Cult') );
The topic ‘Display Posts from Custom Post type by Taxonomy’ is closed to new replies.