I wanted to loop through these four pages. Basically I would like my loop create a "li" by "page_id". I just know this is from my "new WP_Query" which is not good.

How would you be doing? Here is my code:

<?php $query = new WP_Query('page_id=50' || 'page_id=53' || 'page_id=56' || 'page_id=58'); ?>
<?php while ($query->have_posts()) : $query->the_post(); ?>
        <?php the_field('my-content'); ?>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>

1 Answer 1


Use the proper parameter. Try this:

$post_ids = array( 50, 53, 56, 58 );
$query = new WP_Query('post__in' => $post_ids );

More info

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.