Forums › Forums › Search & Filter Pro › Search in one category only
Tagged: Avada, one category
- This topic has 26 replies, 3 voices, and was last updated 8 years, 6 months ago by Trevor.
-
Anonymous(Private) April 7, 2016 at 6:32 pm #41973
Hello,
I am using Avada Theme and currently using the CPT Portfolio to publish items that the company I work for offers, with this CPT there are two taxonomies: Portfolio Categories which I use to categorize the type of items and Portfolio Skills that I use to categorize the availability of those items in some countries.
I am creating a page for each single Category and I’d like to use S&F to search the availability of those items in different countries, so I’d need S&F to look and work a bit like this http://bit.ly/1SCYVX9 where Cursos de Idiomas is the only category selected and the countries where this program is available are listed (it could be in a dropdown, check list or something else, as long as this works).
Could this be done?
Thank you!
Trevor(Private) April 7, 2016 at 7:14 pm #41980In the form setup you can specify to look in specific categories or just one, all you need is the ID number of the category. Is that what you want? This would mean making a form for each results page, but I am sure there is a coding way to do it, which Ross will know, using a filter. I am thinking that you have one form, with the category field in it but hidden, and then use the Input Object filter, seen on this page:
Ross Moderator(Private) April 7, 2016 at 7:28 pm #41983Just include the category field (portfolio categories will actually be a taxonomy field) in the search form and tick the options in “detect defaults from current page” (in the “general” tab of your search form)
Thanks
Anonymous(Private) April 8, 2016 at 11:07 pm #42113Thank you Ross and Trevor, I tried doing what Ross said but now I’m having this error in S&F:
Error: There are 2 Search Forms set to use Post Type Archive display mode for the post type Portfolio – you may only have 1
How can I fix this?
In my homepage I have a form to search for Portfolio Items according to the Portfolio Category and Portfolio Skills. I am using the Portfolio CPT to display Programmes to study abroad, Portfolio Category to classify them into types of programmes (e.g. High Schools, Boarding Schools, Language Schools, etc) and Portfolio Skills to display the availability of each type of programme in different countries (e.g. High Schools in the USA, Boarding Schools in Switzerland, Language Schools in Canada…).
Then, in each Category page I am using another form to search the availability of just one type of Programme (e.g. Language Schools) in different countries.
I hope you can help me!
Anonymous(Private) April 8, 2016 at 11:08 pm #42114I forgot to say, I ended up trying what Ross said because I’m not very good with PHP and it worked, but now I have that error and the form in my homepage behaves just like the one I have in my Language Schools page (I forgot to add the link so here it is).
Anonymous(Private) April 12, 2016 at 12:09 am #42388I’ve been searching for a way to do this and I found this https://support.searchandfilter.com/forums/topic/2-search-forms-for-same-post-type-archive/ but I don’t understand how I could find out the full URL of my post type archive. Please help me! 😀
Trevor(Private) April 12, 2016 at 9:39 am #42410If you have a Portfolio CPT its WordPress ‘slug’ name is likely to be
portfolio
WordPress simply appends a CPT slug to your site URL to make the CPT archives page URL, so, if your site URL was
http://mysite.com/
then the Portfolio archives URL would behttp://mysite.com/porfolio/
, does that help? Note it has a slash on the end, and it needs http or https on the front, as shown.Anonymous(Private) April 12, 2016 at 4:45 pm #42506I’ve tried with http://mysite.com/porfolio/ and http://mysite.com/avada_porfolio/ with no success. I have asked in the Avada forum if anyone knows the URL for the portfolio CPT.
Anonymous(Private) April 12, 2016 at 5:39 pm #42510Hahaha I used my own domain name :p
I found out the URL but it’s not displaying results as it should, when I select “Canada” under “Summer Camps” it doesn’t show me the summer camps available in Canada but it shows all programmes in Canada. The same happens when selecting another country, it displays all programmes available in the selected country instead of just the summer camps.
I have included only to search in the “Summer Camps” taxonomy and the available countries for summer camps, I have even selected the tags that would only include summer camps but it still shows all programs in each country.
You can see it here http://edulynks.com/2/campamentos-de-verano
The CPT url is http://edulynks.com/2/nuestros-programas-en-el-extranjero/
-
AuthorPosts