Forums › Forums › Search & Filter Pro › Use just for filters on custom post type archive
- This topic has 30 replies, 3 voices, and was last updated 8 years, 10 months ago by
Trevor.
-
Anonymous(Private) August 26, 2016 at 4:44 pm #55834
Is there any way to get a sort of soft ETA? Needing to relay this to the client since we are really really close to launching.
I understand just because I spent $20 doesn’t mean you guys work for me or owe me immediate turn around, just trying to get timelines together so I can be clear.
Ross Moderator(Private) August 31, 2016 at 12:43 pm #56197Hey Richard
Ok so I took a look…
I noticed a couple of problems you were having so made some modifications to get it working in a basic way…
First, because you want to show your search results on the recipes (CTP) archive page, then all you have to do is set S&F display method to “post type archive” – https://www.designsandcode.com/documentation/search-filter-pro/search-results/as-a-post-type-archive/
This means S&F will use the main / global query and modify it according to user selection – this worked great for me.
Second, there is a major problem in the way the search form is added to your search bar… S&F creates its own search form when you place a shortcode, this means all S&F forms are wrapped in
<form>...</form>
tags.. in your partialrecipe-search.php
, you’ve placed the shortcode inside another<form>
tag (line 1) – this will never work and is not allowed in html.So, you need to place S&F outside of the form tags, or remove the existing ones there if you plan to replace your current search with S&F – I simply moved the S&F shortcode (line 33) to the bottom of the file (recipe-search.php), and although ugly, combined with the above, the search began working as expected…
Lastly, I noticed in your search form you had a field called “cuisine” – it was using the meta key
_cuisine
– notice the underscore… ACF adds two meta keys for every custom field, one with an underscore and one without – its the one without you need – so I changed the meta key locally tocuisine
and this field started working working 🙂Best
Anonymous(Private) September 2, 2016 at 8:43 pm #56490This gave me exactly what I needed. Thanks so much for your help.
I have one last question. I want to use ajax on this, but now that I have it working when I get the new results with an ajax call it breaks my isotope grid. Is there a javascript call I can make to rebuild my isotope grid after the ajax call is made?
Trevor(Private) September 3, 2016 at 9:20 am #56518Yes, this is shown on the FAQ page:
https://www.designsandcode.com/wordpress-plugins/search-filter-pro/faqs/
You will need this one:
$(document).on("sf:ajaxfinish", ".searchandfilter", function(){ console.log("ajax complete"); //so load your lightbox or JS scripts here again });
Is this thread now resolved and can I close it?
-
AuthorPosts