Forums › Forums › Search & Filter Pro › S&F Pro with Avada search.php
- This topic has 9 replies, 2 voices, and was last updated 9 years, 11 months ago by Ross.
-
Anonymous(Private) January 5, 2015 at 11:47 am #9768
Hey,
Just purchased the S&F Pro – great plugin!
I am using the Avada theme and would like the Ajax search results to be displayed as a grid. How can I go about doing this? Should I use the existing Avada search.php template (and select the grid search results layout in the theme options) and modify it somehow? Or is there some way that I should modify the results.php template file that comes with the S&F Pro plugin?
It seems from a previous post that you have some familiarity with the Avada theme – apologies if this is not the case.
Thanks in advance,
DanRoss Moderator(Private) January 8, 2015 at 9:38 pm #9972Hey Daniel
I’ll try to help – I’ve used Avada for very basic purposes but I am familiar and have done some implementations.
First, make sure you are updated to the latest version of the plugin (1.4.0).
What I think would be the best course of action is to duplicate search.php and give it a unique name – eg
search-filter.php
In this file you must comment out the custom query (as per instructions on this post)
Then in S&F admin – go to “display results” and select “as archive”…
Then scroll down, you will see use “custom template” – tick this and underneat enter “search-filter.php” or the filename of your template.
Basically, now we have the search template working with your theme – but we are free to customise it…
I think that if you change the grid search results option in the theme options that this will be respected in your template.
If this does not work I would also recommend to goto the “advanced” tab, and ticking “force is_search to always be true”.
Let me know how you get on 🙂
Thanks
Anonymous(Private) January 9, 2015 at 12:04 am #9978Thanks for this Ross. I’ve tried the above (including forcing is_search to be true) however it seems that regardless of what my input to the search form is I get the “Couldn’t find what you’re looking for!” page, and the search form no longer visible.
Ross Moderator(Private) January 9, 2015 at 12:30 am #9980Ah you mean when you enable “force is_search to true”? If thats teh case leave it disabled then – its only there to help in some circumstances..
What happens when you’ve disabled that option, and followed the steps above such as removing the custom query in the template?
Thanks
Anonymous(Private) January 9, 2015 at 5:37 am #9991Ok I’ve disabled the is_search forcing, removed the query_posts() custom query from the Avada template file and set display results to “As an archive page” with the name of the new custom template in the textbox. I’ve then inserted the
[searchandfilter id="XX"]
shortcode into the page that I want to use for the search. It unfortunately still doesn’t seem to work.Ross Moderator(Private) January 9, 2015 at 10:37 am #9995And you’ve replaced the XX above with your ID (sorry had to check!)?
Can you send me a link to look at?
Thanks
Ross Moderator(Private) January 10, 2015 at 4:40 pm #10074Haha hey again…
There is a line here (75) which might need to be modified:
<?php if ( have_posts() && strlen( trim(get_search_query()) ) != 0 ) : ?>
Basically, the loop (that goes through your results) will only be entered if there is a search query (ie a search term –
?s=searchterm
in your URL)….So you probably should modify this line to:
<?php if ( have_posts() ) : ?>
🙂
Ross Moderator(Private) January 11, 2015 at 12:39 pm #10098The best way to debug this is to disable ajax first…
Then you will see when you submit the form still disappears – this is because you need to add the shortcode to the php template itself.
Once you’ve done that, and your start page and your results page look the same then we can re-enable ajax 🙂
Thanks
-
AuthorPosts