How to display certain posts by their id? I do this:

$recent = new WP_Query(['p' => 10207]); 

Displays only one, as indicated by one id. I do this:

 $recent = new WP_Query(['p' => [10207, 10117]]); 

A request error occurs.

    1 answer 1

    p takes only one number. Use post__in:

     $recent = new WP_Query( array( 'post__in' => array( 10207, 10117 ) ) ); 
    • It turned out, thanks! - LexXy