D
D
dimasibirak2017-03-02 16:28:44
Web development
dimasibirak, 2017-03-02 16:28:44

How to pass product property to wp_query?

Hello dear forum users, it is not possible to make a selection by the woocommerce product property

$attributes = $product->get_attributes();
            $argss = array(
            'post_type' => 'product',
            'post_status' => 'publish',
            'cena-polotna-banner'=>array('value'=> 4500), 
            'ignore_sticky_posts'	=> 1,
            'posts_per_page' => 50,
            'tax_query' => array(
            array(
            'taxonomy' => 'product_cat',
            'field' => 'id',
            'terms' => $cat,
            )
            )
             
            );

            $loop = new WP_Query( $argss );
while ( $loop->have_posts() ) : $loop->the_post();

Everything works except 'cena-polotna-banner'=>array('value'=> 4500),
Please tell me what am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
webpixel, 2017-03-02
@webpixel

WP_Query doesn't have 'cena-polotna-banner' argument, use this https://codex.wordpress.org/Class_Reference/WP_Que...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question