Forums › Forums › Search & Filter Pro › display the current category inside Post and make it load search form
Tagged: category post load
- This topic has 3 replies, 2 voices, and was last updated 4 years, 7 months ago by Trevor.
-
Anonymous(Private) April 29, 2020 at 11:32 am #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 ?
ThanksTrevor(Private) April 29, 2020 at 1:31 pm #241950Which 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.
Trevor(Private) April 30, 2020 at 3:07 pm #242211I 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
-
AuthorPosts