Forums Forums Search & Filter Pro ACF / Post Meta Fields in current_query() Result

Tagged: ,

Viewing 3 posts - 1 through 3 (of 3 total)
  • Trevor
    #249704

    You first need to find out where the data is, and to do so you need to examine the filter array:

    <?php
    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(1526)->current_query()->get_array();
    echo '<pre>',print_r($sf_current_query,true),'</pre>';
    ?>

    This will print that array to the screen. From that you would need to use code LIKE this:

    echo $sf_current_query['_sft_category']['active_terms'][0]['name']

    This would echo out the first Category term. You will need to write a similar line, for example:

    echo $sf_current_query['_sfm_industries']['active_terms'][0]['name']

    Anonymous
    #263899

    gotcha, thanks.

    Trevor
    #263904

    If that works for you, is OK to close this thread?

Viewing 3 posts - 1 through 3 (of 3 total)