loop prodcuts with specific attribute
-
I need to loop on homepage of my site only product with specific custom attribute.
i have set in some products an attribute with slug “best” and need to filter only value “yes” of that attribute.
I’ve tried:
$args = array(
‘post_type’ => ‘product’,
‘numberposts’ => -1,
‘meta_query’ => array(
array(
‘key’ => ‘best’,
‘value’ => ‘yes
)
));
$my_query = new WP_Query($args);//print_r($my_query);
if ( $my_query->have_posts()) : while ( $my_query->have_posts() ) : $my_query->the_post(); $_product = new jigoshop_product( $post->ID );
… but no result… could you please help? thank you very much
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘loop prodcuts with specific attribute’ is closed to new replies.