WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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) );

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

share|improve this question
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
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

Your Answer


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.