TransWikia.com

WP_QUERY post_in problem

WordPress Development Asked on November 19, 2021

why when i using this code :

$paramss = array('post_in' => array( 760, 761) , 'post_type' => 'product');
$wc_querya = new WP_Query($paramss);

i get 5 products list and not only product with id 760,761 ?

Regards

One Answer

As documented, it's post__in, with two underscores:

$paramss = array( 'post__in' => array( 760, 761 ) , 'post_type' => 'product' );

Answered by Jacob Peattie on November 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP