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 want to display in a featured slideshow only 3 posts, but it is ignored and it shows a lot of posts. How to fix it?

$my_query = new WP_Query(
    array( 
        'posts_per_page' => 3, 
        'post_id' => $featitem 
    )
);
while ($my_query->have_posts()) : 
    $my_query->the_post(); 
share|improve this question

1 Answer 1

post_id is not a WP_Query parameter. Perhaps you meant post__in? If so then $featitem needs to be an array of post IDs.

share|improve this answer

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.