AnonymousInactive
I just updated to WordPress 4.9.8 and I’m on Search & Filter Pro Version 2.4.5.
Since the update my page displays this:
[searchandfilter id=”160″ show=”results”]
…instead of the actual results.
I have a customized the results.php file, which was working perfectly until this update. Any pointers for how to troubleshoot this?
You can replace the contents of the results.php with this:
<?php
/**
* Search & Filter Pro
*
* Sample Results Template
*
* @package Search_Filter
* @author Ross Morsali
* @link https://searchandfilter.com
* @copyright 2018 Search & Filter
*
* Note: these templates are not full page templates, rather
* just an encaspulation of the your results loop which should
* be inserted in to other pages by using a shortcode - think
* of it as a template part
*
* This template is an absolute base example showing you what
* you can do, for more customisation see the WordPress docs
* and using template tags -
*
* http://codex.wordpress.org/Template_Tags
*
*/
if ( $query->have_posts() )
{
?>
Found <?php echo $query->found_posts; ?> Companies<br />
<?php
while ($query->have_posts())
{
$query->the_post();
?>
<div>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<p><br /><?php the_excerpt(); ?></p>
<?php
if ( has_post_thumbnail() ) {
echo '<p>';
the_post_thumbnail("small");
echo '</p>';
}
?>
</div>
<hr />
<?php
}
}
else
{
echo "No Results Found";
}
?>
I am not sure what you mean by:
The infinite scroll should be bigger (double size) How can I increase it?
and also
The displayed results (the names of the companies) should not link to the Post-site. They should link to my individual site.
The shortcode display results method uses our exemplar template – results.php. The basic steps for customising the file are set here, but you would need to do the coding:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results
In the main you would be deleting parts. Are you currently using an unmodified version of that file?
AnonymousInactive
Hi there,
I’ve enabled Relevanssi on my WordPress site, including the breakdown and highlighting features, as well as enabled it in the Search & Filter Pro settings, yet neither feature are showing up in my search feed. The excerpt also appears to be showing the WordPress default excerpt, rather than the Relevanssi excerpt.
I’ve tried both using the search results as an archive and shortcode (using the default results.php template that your plugin provides) and neither work. I’m using the Bridge theme. Are there any documented cases of incompatibility between the two?
Any ideas? Thanks!
To the error; if it only randomly happens, it will be hard to track down, but my first though is that it must be something to do with these settings:
https://www.screencast.com/t/EoLysM5EqD
Maybe try changing what they are currently set at?
Assuming you are using the Shortcode Display Results method:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/
If so, I assume you copied the results-infinite-scroll.php template instead of the results.php template when you followed the customising guide there? It still needs to be named results.php in the child theme, so it would need renaming. It looks like this by default:
<?php
/**
* Search & Filter Pro
*
* Sample Results Template
*
* @package Search_Filter
* @author Ross Morsali
* @link http://www.designsandcode.com/
* @copyright 2015 Designs & Code
*
* Note: these templates are not full page templates, rather
* just an encaspulation of the your results loop which should
* be inserted in to other pages by using a shortcode - think
* of it as a template part
*
* This template is an absolute base example showing you what
* you can do, for more customisation see the WordPress docs
* and using template tags -
*
* http://codex.wordpress.org/Template_Tags
*
*/
if ( $query->have_posts() )
{
?>
Found <?php echo $query->found_posts; ?> Results<br />
<div class='search-filter-results-list'>
<?php
while ($query->have_posts())
{
$query->the_post();
?>
<div class='search-filter-result-item'>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<p><br /><?php the_excerpt(); ?></p>
<?php
if ( has_post_thumbnail() ) {
echo '<p>';
the_post_thumbnail("small");
echo '</p>';
}
?>
<p><?php the_category(); ?></p>
<p><?php the_tags(); ?></p>
<p><small><?php the_date(); ?></small></p>
<hr />
</div>
<?php
}
?>
</div>
<?php
}
else
{
?>
<div class='search-filter-results-list' data-search-filter-action='infinite-scroll-end'>
<span>End of Results</span>
</div>
<?php
}
?>
On line 29 is this:
Found <?php echo $query->found_posts; ?> Results<br />
Simply delete that line and save.
As to the loading icon, this thread might help:
https://support.searchandfilter.com/forums/topic/search-filter-scroll-loading-icon-positionning-in-infinite-scroll/
Ah, OK. You would need to be editing that results.php file to add some of your own code, but I have no suggestions as to what that code might be. I think you know which part needs to be changed, yes?
AnonymousInactive
Thanks again for directing me in the right way.
I got it to work how I wanted to:
http://supernanny.purepixels.nl/onze-au-pairs/
One more functional question if you don’t mind.
I have a custom field with date of birth. With PHP I calculate the current age and display it in the results.php.
I would also like to use a range slider to filter on age, however this field is in the DB as dd-mm-yyyy.
Do you have any advise how to accomplish this?
AnonymousInactive
Hello Trevor
Thank you for the prompt reply. I actually already thought of doing what you suggested, but I have not been able to determine the contents of the S&F Pro results array in order to link each item of the query result to the Pod data. Can you tell me how I access the data array for the S&F Pro results?
As I mentioned in my earlier post, I tried to find raw search data using your instructions at https://searchandfilter.com/documentation/accessing-search-data/ but none of these do anything. They don’t cause any errors, but neither do they echo/print/display the information that they are supposed to. They literally generate nothing on the page. Can you advise how I access the search results data in order to be customise my results.php with additional data from the Pod?
Thank you for your assistance.
Are you able to share with me the contents of the customised results.php file that you are using?
As you are using the Shortcode Display Results method, I think that part of the page is not controlled by the results.php file, but by your theme’s page.php file.
Did we previously discuss which Display Results Method to use, because the only one I could think would work would be the Post Type Archive method, assuming that is is searching only one Post Type and the taxonomies are not shared by other Post Types?