Forums Forums Search & Filter Pro Search in one category only

Viewing 10 posts - 1 through 10 (of 27 total)
  • Anonymous
    #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
    #41980

    In 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:

    http://www.designsandcode.com/documentation/search-filter-pro/action-filter-reference/#Filter_Input_Object

    Ross Moderator
    #41983

    Just 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
    #42113

    Thank 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
    #42114

    I 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
    #42388

    I’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
    #42410

    If 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 be http://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
    #42506

    I’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.

    Trevor
    #42507

    I am hoping that you didn’t actually those exact urls, as the mysite bit you need your url 😉

    If you can go to a single portfolio page, the url will give the clue as the the slug for the archives, usually.

    Anonymous
    #42510

    Hahaha 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/

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