Using facetWP, how do I filter by a facet in a WP_Query?

799 views Asked by At

How do I add a facet filter to WP_Query? Here is what I'm trying, how do I get a ticket_price of 2:

$args = array(
    'post_type'         => 'ticket',
    'posts_per_page'    =>  200,
    'facetwp' => true,
    'facet' => array(                   
        'name' => 'ticket_price',
        'value' => '2',                             
    ),
    'tax_query' => array(
    array(
        'taxonomy' => 'ticket_state',                                       
        'terms'    => 351,
        ),
    ),              
);
$reportQuery = new WP_Query( $args );

None of these appear to do exactly what I need: https://facetwp.com/documentation/developers/querying/

Their support is closed until Jan 2nd, anybody strong with facetwp?

0

There are 0 answers