Empy CPT shows all posts
-
Hey
I am using this plugin and in general it works really well so thank you.
I am a bit stuck on the this:
I have CPT’s for Albums and Artists and it works well. So if I click on an artist, all of their albums display.
My issue is if I have an artist that has no albums assigned to them yet, then all of the albums for other artists show up.
Any ideas?
My code is:
$objects = $cpt_onomy->get_objects_in_term( $post->ID, 'artists' ); $args = array( 'post_type' => 'albums', 'post__in' => $objects, 'meta_key' => 'release_date', 'orderby' => 'meta_value', 'order' => 'DESC', ); query_posts( $args ); if ( have_posts() ) :
- The topic ‘Empy CPT shows all posts’ is closed to new replies.