Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro How to display Taxonomy in Search Results.php?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Maxwell White
    #200984

    Hi! Still loving this plugin. It quickly became a favorite. Quick question: I have results.php with the following else:

    `
    else
    {
    ?>
    <div class=’search-filter-results-list’ data-search-filter-action=’infinite-scroll-end’>
    <h3>We couldn’t find anyone with “<?php
    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(4716)->current_query();
    echo $sf_current_query->get_search_term();
    ?>”.</h3>
    </div>
    <?php
    }
    `

    My problem though is that when I sort by a taxonomy, eg orgs or divisions with a drop down cromobox without a search term the "". is left blank. What do I need to add to the above to return the taxonomy/taxonomies?

    Thanks!

    Maxwell White
    #200985
    This reply has been marked as private.
    Trevor Moderator
    #201022

    Hi

    There is a code back tick on most keyboards; use that once before and once after the code you post. On my keyboard it is the key to the left of the 1 key.

    As to fetching the search terms, the https://searchandfilter.com/documentation/accessing-search-data/ guide is basic but you can extend the idea to grab lost of other data. If you have other filters, then it becomes a little more complex, but I can give you links. This thread might help you:

    https://support.searchandfilter.com/forums/topic/accessing-field-slug-on-search-results/

    … and this search will give similar threads I think:

    https://support.searchandfilter.com/forums/search/sf_current_query+get_array+field+%5Bvalue%5D/

    Maxwell White
    #204248
    This reply has been marked as private.
Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘How to display Taxonomy in Search Results.php?’ is closed to new replies.