WP_Query and post__in
-
Hi, folks!
I used page_options to define my frontpage posts, and use this code to get que posts for a slide
$slide_home = get_option('posts_home-slide'); // this retuns a string like this "481,1,922' $include = explode(',',$slide_home); $argsSlide = array( 'post_type'=>'any', 'post_status'=>'publish', 'posts_per_page'=>'-1', 'post__in'=>$include ); $slide = new WP_Query($argsSlide); if ($slide->have_posts()): while($slide->have_posts()): $slide->the_post(); endwhile; endif; wp_reset_query(); wp_reset_postdata();
But this query did not return the 3 posts I pass in post__in and return more than three. Someone could help me?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘WP_Query and post__in’ is closed to new replies.