AnonymousInactive
Hi,
I am having trouble with shortcode S&F integration.
I have the correct shortcode within the code as the form and initial results are being shown. However, when I use the form and click submit the page reloads, the form resets but the results do not update.
I have turned off AJAX and double checked the URL for shortcodes. All is correct.
I am not using my own results.php template, I am trying to make it work straight out of the box.
I am also using it on WordPress 4.5.
Any help would be much appreciated.
I think you would need to edit and remove lines 29 and 30 of this file:
results.php in the templates folder. Depending on the display results method you are using (I am assuming you are using the shortcode method), you can copy that file to a sub-folder (you need to make this folder, if you don’t already have it, called search-filter) of your theme folder. That way any plugin updates won’t break this change. The lines look like this:
Found <?php echo $query->found_posts; ?> Results<br />
Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br />
See the documentation here (the Customising the Results section):
Using A Shortcode
AnonymousInactive
Hang on! I found your “results.php” in the template folder. I think I got it. Sorry for not looking first, and then asking support. Thanks
The only thing that I can see is that as you have selected use custom template the results template is shown as results.php, but I think this needs to be changed to one from your theme; whichever template is used for the search results page in the theme. Alternatively, untick this box and let S&F try to find the template itself (it may fail to find it though).
AnonymousInactive
Thanks Trevor!
I am using a theme I started from underscores template
Installed the results.php template and I am trying to use the github code here as reference.
but no luck yet..
Any chance you can guide me a bit further?
Where do I place the following code in my results.php if it needs to be before the “have_posts” loop?
global $searchandfilter;
$sf_current_query = $searchandfilter->get(1726)->current_query();
echo $sf_current_query->is_filtered();
Hi Bjarni
Hopefully that little chat was useful. To recap, when editing the results.php file, your advantage is that your chosen theme uses Bootstrap 3, and as such you can take advantage of the generic Bootstrap 3 classes and add these to the HTML elements in the php file, as well as any you can see used by your theme when you inspect demo pages.
IF you find that I was correct, and it is using that results.php file, then you would need to edit the file to meet your needs. I can show you how if you wish. But, you would need Skype to be able to do that with me.
If you are using the shortcode method, it should be using the results.php template that is inside the plugin templates folder. You can make your own version so you can customize this. See this page:
http://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/#Customising_the_Results
AnonymousInactive
Hello Trevor!
Thanks for helping me earlier. I did what you told me (copying the results.php page to /themes/Avada/search-filter) but I’m getting this error: Error: The custom template file results.php cannot be found – go to Display Results tab to fix
I also tried placing it in the child theme but I’m still getting the same error.
I’m not very good with php so I’m having a bit of a hard time customizing the results.php file, so I was wondering if you have an example of how a results page looks customized (code & visual) because I’m only good at HTML and CSS hehe 🙂
Thank you!
AnonymousInactive
I am using the shortcode results page method with a custom results.php file. I have a custom taxonomy as my first drop down and categories as my second. No matter the settings that I choose (AND vs OR, AJAX, no AJAX) the Categories drop down always shows 0 results for every category.
You can view the page on our dev site here: http://633.c25.myftpupload.com/search-test/