toggle menu

Getting search behalf of product taxonomy & meta query

Dhananjay Kumar |28 Apr at 07:04

I have implement in wordpress search for the prodcut taxonomy & meta fileds (for extra fileds by advance custome fileds).

Please review below my script.

<?php
$args['post_type'] = 'product';
$args['tax_query'] = array(array(
                                'taxonomy'  => 'product_tag',
                                'field'     => 'slug',
                                'terms'     => slug_name'',
                                ));   
$args['meta_query'] = array(array('key'=> $key,
                                  'value'          => $val,
                                  'compare'     => '=',
                            ));
query_posts( $args );

?>

 

  • 1 like
  • 0 comment

Posted:

28 Apr at 07:04

Viewed:

1092 times

Active:

02 May at 12:05