In the plugin folder, in a templates sub-folder, are two exemplar files, and our plugin uses the one named results.php by default. This documentation tells you to place one of these two files in a search-filter sub-folder of your child theme. Obviously, if you are using infinite scroll, copy that one, otherwise copy the other.
Then, with that file in the new search-filter sub-folder, rename the file to results.php if needed. It must always be named that, or named the same ID as each for the forms (allows more than one template to be used).
The documentation for this is here:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/
The Not Loading issue is this:
Fatal error: Call to undefined function the_field() in /storage/content/78/125678/dev.frakka.se/public_html/wp-content/plugins/search-filter-pro/templates/results.php on line 82
I would take a look at that file and that line to find the error. If it is the standard results.php file, it is this:
if (function_exists('wp_pagenavi'))
{
Do you have the WP-PageNavi plugin installed?
Temporarily change the form from Shortcode to Custom will stop the error whilst you try to fix it.
I am not sure what the failure to update is. You could try a manual update (download the file from Your Account area, deactivate and delete the existing version, and upload and install the new version).
AnonymousInactive
Hi,
We are using Search and Filter Pro to show the available floor plans for Classic Homes as seen on this page:
https://classichomes.com/new-homes/
For some reason, the category metadata is not showing in the results. It was working previously, and that portion of the results.php file was not modified. Relevant code snippet pasted below:
<?php
$postcat = get_the_category();
if ($postcat) {
foreach($postcat as $cat) {
if ($cat->parent != 0) {
echo $cat->name . ‘, ‘;
}
}
}
?>
Any help you can provide would be awesome! Thank you!
AnonymousInactive
Okay! I was able to successfully display the posts using shortcodes and have replicated the results.php page to customize the html. All of that looks fine, it’s just that I seem to be having some issues with Ajax and submitting my search. The auto search does not load the category I have selected and neither does the submit button. The Results Url is correct (the same page I have the shortcodes listed) I’m not sure what else could be wrong.
AnonymousInactive
Yes, it is the same instructions. I copied the results.php file to the search-filter folder in my themes folder.
All I’m looking to do is add a few things to the search results for each listing including an image and some other stats for users to see before clicking to see the whole result.
You can either make a results.php file per form. So, if a form is ID # 1234 then you name the results.php for it 1234.php.
Or you can use PHP, like this (I think):
<?php
global $searchandfilter;
if ( $searchandfilter->active_sfid() == 1234) {
// do this
} else {
// do that
}
?>
AnonymousInactive
Is there a way to get the sfid in results.php (so that I can basically do an if/else to change some display text)?
In the results.php file, there is this line:
<p><br /><?php the_excerpt(); ?></p>
Your theme might be adding the extra <p> parts. Try changing the line to this:
`<div><?php the_excerpt(); ?></div>
Are you using our Shortcode Display Result Method, as described here:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/
If so, follow the guide on customising and then edit that new results.php file, where you will find the text you are looking for.
The template code used for the results is not standard (as per the exemplar results.php file). Does this still happen if instead you use the default results.php template file?