Forums Forums Search & Filter Pro display the current category inside Post and make it load search form

Viewing 4 posts - 1 through 4 (of 4 total)
  • Anonymous
    #241926

    Hi. I am searching for a way to load a search and filter form when clicking a catégory in the post
    I usually use <?php the_category( ‘, ‘ ); ?>

    Example :
    I click on “recipe” category inside my post. And I want it to go to the search and filter form and load all the recipes.

    Is it possible with Search and Filter pro ?
    Thanks

    Trevor
    #241950

    Which Display Results method are you using? For a single Post Type, the ‘Post Type Archives’ one is often best, because it lets you keep the standard WordPress permalinks, instead of the query string you have showed an example of. But, that depends on whether it works with your theme.

    These screenshots are for the Post Type Archive method:

    You need to set autodetect category/taxonomy:

    https://www.screencast.com/t/3B40jPYRF4SA

    And also enable filtering on Taxonomy Archives (the taxonomy also needs to be in the form itself):

    https://www.screencast.com/t/piCPyshb6

    So, as long as Category is also in the form, when your site goes to the category page, the category for that page will be set in the form, and thus the posts that show would be of just that category.

    Anonymous
    #242068

    Hi and thank you for your message.
    Unfortunatly I am using the shortcode method with a custom $query.
    What is the method do to it with the shortcode display result ?
    Thanks again

    Trevor
    #242211

    I understand. IF all you wanted was to make a new search (and not retain the current search), then you would need to edit the code in the results.php code using our guide to customising and make the link something like this:

    http://mysite.com/my_search_page/?_sft_category=my_category_slug

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