WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

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.