Support Forums

Support Forums Forums Search & Filter Pro Taxonomy Dropdown: only show based on included Tags, Categories & Taxonomies

This topic is: not resolved

This topic contains 16 replies, has 2 voices, and was last updated by  Trevor 5 months, 2 weeks ago.

Viewing 10 posts - 1 through 10 (of 17 total)
  • Luke Hartman

    Hello, your plugin is working great for our site! Thank you for the excellent development 🙂

    I did have one question, how can we limit what shows in the taxonomy dropdown strictly based on the Tags, Categories & Taxonomies(in our situation it is Categories) we have chosen to include.

    Per our example:
    Search in the following post types: Custom Post Type (catalog)
    Display results method: As an Archive, custom templates for each category results(ex. search-catalot-film.php, search-catalog-album.php. . .)
    Tags, Categories & Taxonomies: Include one category per search template file.

    And that is about as far as I got on filtering what shows in the Taxonomy dropdown. Here’s one of out taxonomy sorting setups:

    Taxonomy sorting setup: Directors

    Like in the Director’s taxonomy, we have a ton of Directors, but there is no need to show every single Director when you are filtering in the Albums page. Albums don’t generally have “Directors”. We would like to show only the taxonomy terms that are included in the categories.

    All directors show up on Alubms page dropdown.

    I hope my explanation is ok 🙂

    Thanks again!

    Luke Hartman

    Taxonomy sorting setup: Directors

    All directors show up on Alubms page dropdown.

    The images that didn’t go up earlier ^^^

    I’m also having trouble sorting our custom post types by the date ACF I set up. I have it set to numeric:

    Search and filter premiere_date

    My ACF settings for premiere_date:

    The premiere_date ACF in my single-catalog.php file:

    Any help would be super helpful!


    Luke Hartman

    Here is a look at the results from old to new sorting:


    They bounce all around. From 1987 to 2000 to 1983 ext.

    Thanks again for your help!!

    Trevor Moderator
    This reply has been marked as private.
    Luke Hartman

    Hey Trevor, thanks for getting back to me!

    I’ll send you the login first and then if that doesn’t fix it we can go to the second route.

    **Posting this message for any future visitors trying to follow the conversation so they can find a fix as I did!

    . . . sending a private message next. . .

    Luke Hartman
    This reply has been marked as private.
    Luke Hartman

    A good example Search and filter sidebar from the site I sent you: /category/distribution/film/

    If I search “new to old” (meta value, ascending) on the film page this is the URL ending: /?sfid=4737&sort_order=_sfm_premiere_date+desc+num

    “old to new” : /?sfid=4737&sort_order=_sfm_premiere_date+asc+num


    Each of our 4 subcategories has their own search results template file.


    I did this so we can have 4 separate Search & Filter shortcodes to display on their respective search results page.


    This might be the long way around, but it made sense to me. Please let me know if you have a smarter way of doing this conditionally or something 🙂

    Since my search is loaded via an off-canvas element I have a file search-off-canvas.php that conditionally checks what category the page is on and loads the proper shortcode:

    $categories = array( 1973, 1974, 1975, 1976, 1979, 1980 );
    if (is_category($categories)) :?>
    if (is_category(1973)) { // film
        echo '<h4 class="ml-2">Search Films</h4>';
        echo do_shortcode('[searchandfilter id="4737"]'); // film
    } elseif (is_category(1976)) { //series
        echo '<h4 class="ml-2">Search Series</h4>';
        echo do_shortcode('[searchandfilter id="4740"]');
    } elseif (is_category(1975)) { //special
        echo '<h4 class="ml-2">Search Specials</h4>';
        echo do_shortcode('[searchandfilter id="4741"]');
    } elseif (is_category(1974)) { //album
        echo '<h4 class="ml-2">Search Albums</h4>';
        echo do_shortcode('[searchandfilter id="4742"]');

    As always, if you see a better way to do this, please let me know.

    Let me know how I can help you on this.

    Thanks Trevor!!

    Trevor Moderator

    I added premiere_date to the form so that I could see what values are stored in the database. I will screenshot this so you can see how I did this (I did not save the form):

    You can see that the dates are in the wrong format to be sortable. They should look like YYYYMMDD, so today would be 20190111.

    The return format in the field definition seems to be right (Ymd), so maybe these were stored before that was made, or …. ?

    Luke Hartman

    I think you’re right. These would have been entered into the database long before I set up your plugin. So what should we do to re-enter the dates into the database? Or something else entirely??

    Trevor Moderator

    How many posts are there?

Viewing 10 posts - 1 through 10 (of 17 total)

You must be logged in to reply to this topic.