Forums › Forums › Search & Filter Pro › Template/shortcode
- This topic has 7 replies, 3 voices, and was last updated 8 years, 8 months ago by Ross.
-
Anonymous(Private) April 29, 2016 at 12:14 pm #44347
I have some kind of a template/shortcode problem. Please visit fitnesskeuze.nl. There I made a custom post type ‘sportscholen’, and I am using ACF for some fields. I know (thanks to your support), I have to use Relevanssi to index the fields and that is working.
I have an archive page ‘archive-sportscholen.php’. There I want to show the whole collection and search/filter the results on the same page, so not a ‘fall-back’ to index.php. That happended yesterday after playing with the many display options. Now I am on the same, but nu results.
I used the shortcode on that specific archive page with the template ‘Sportschool’. It shows (as you can see) two ‘records (there is nothing more yet). And in the sidebar the searchform. However any search ‘task’ does not do anything here….. Could you help me one step further?
Kind Regards,
Peter LuitRoss Moderator(Private) May 6, 2016 at 3:40 pm #44919Hey Peter
I took a look.
Ok, I am having a hard time figuring out exactly what you are trying to achieve – this is my understanding…
So, you have a search page:
http://fitnesskeuze.nl/overzicht/
But the results do not update?
From what I can see, this is a regular page, with the ID 93…
You have set “display results” method to “shortcode”, but you do not use the results shortcode anywhere (should be something like
[searchandfilter id="123" show="results"]
)..Looking at your template code, it looks like perhaps you do not need the shortcode method, instead you would like to integrate S&F with your custom query –
// doe een query op posttype schilderij, aantal 10 en aflopend $loop = new WP_Query( array( 'post_type' => 'sportscholen', 'posts_per_page' =>$berichtenoppagina, 'order' => $sorteervolgorde));
?
In this case, all you need to do is add
search_filter_id
with the value of your search form –119
So the code would be:
// doe een query op posttype schilderij, aantal 10 en aflopend $loop = new WP_Query( array( 'search_filter_id' => 119 ) );
You do not need any of the other parameters, because S&F will overwrite these from the settings inside the search form.
PS, change the display results method to “custom” as you are no longer using the shortcode method.
Thanks
Anonymous(Private) May 9, 2016 at 12:43 pm #45073Hi Ross,
I use a repeating field ‘lessons’ in Advanced Custom Fields Pro. Under this field I use two subfields: ‘name of lesson’ and ‘discription of lesson’. I don’t know hoe many subfields will be used in each record…..
I would like to search on the ‘name of lesson’. So I want a list of all filled in lessons to be displayed as possible search arguments. Looking in ‘postmeta’ I can select any of the used subfields, but only as a fixed field with index. so, ‘name of lesson 1′, ”name of lesson 2’ etc. Is there a way to choose ‘name of lesson’ and that I get all results?
Peter
Ross Moderator(Private) May 10, 2016 at 10:49 pm #45233Hey Peter
We don’t actually support repeater fields – its something I’m looking into – but as of yet, not attempted to add to S&F.
From our product page re ACF:
Essentially, if you are using any of the Basic fields (not text area) or Choice fields then you can filter these in Search & Filter Pro.
In addition to that, although undocumented, we do in fact support relationship fields thanks to some code provided by one of our users.
Thanks
-
AuthorPosts