0

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.

1
  • 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. Commented Jun 30, 2011 at 11:42

1 Answer 1

0

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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