Get posts by multiple ID’s (query)

Question

I try to get multiple post by ID.
For this I created an array for p but I get only the post for the first ID.

<?php
$args = array(
    'p'                      => array('206', '189'),
    'post_type'              => array( 'product' ),
);

$query = new WP_Query( $args );
    while ( $query->have_posts() ) {
        $query->the_post();
        echo '<li>' . get_the_title() . '</li>';
    }
}
?>
0
Bryan 2 months 0 Answers 9 views 0

Leave an answer