Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I can't seem to get post__in to work with custom post types. Is this true? What's the alternative?

$args = array('post_type' => array( 'post', 'page', 'tf_events', 'duka' ), 
   'orderby' => 'menu_order', 'showposts' => -1, 
   'post__in' => explode(',',$mtheme_featured) );
query_posts($args);

$mtheme_featured has two ids separated by commas, one post and one tf_event; only the post is shown.

share|improve this question
1  
This most likely isn't what's causing your problem, but it should be 'posts_per_page' instead of 'showposts'. 'showposts' is for the get_posts() function. –  John P Bloch Jun 30 '11 at 11:42
add comment

1 Answer 1

up vote 0 down vote accepted

You said the post type is called 'tf_event', but in the 'post_type' array it's 'tf_events'.

share|improve this answer
    
it's tf-events. but i'll double check. –  AnaRita Jun 30 '11 at 11:32
    
i added a duka post id. 'post' is showing; duka and tf_events not. –  AnaRita Jun 30 '11 at 11:34
    
ok. something is going on with tf_events; duka is showing. –  AnaRita Jun 30 '11 at 11:38
    
so post__in does work with custom post types! my bad. –  AnaRita Jun 30 '11 at 11:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.