AnonymousInactive
Now I see the problem.
I did not make any changes to the results.php file to customize it but just copied it.
Sorry, I am new to this.
I now opened the results.php in an editor and I also opened the search.php from my template.
Do I have to copy the whole text from the search.php to the results.php?
Ah. If you edit the results.php file that you copied to your (child) theme folder, you will find this code in the middle of it (I have edited it a bit to compress it, but it looks somewhat like this):
<?php
while ($query->have_posts())
{
$query->the_post();
?>
<?php /* echo get_post_mime_type(get_the_ID()); */ ?>
<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>';
}
?>
<p><?php the_category(); ?><p>
<p><?php the_tags(); ?><p>
<p><small><?php the_date(); ?></small><p>
</div>
<hr />
<?php
}
?>
Try replacing that with this:
<ul class="custom-sf-results-list">
<?php
while ($query->have_posts())
{
$query->the_post();
?>
<?php /* echo get_post_mime_type(get_the_ID()); */ ?>
<li><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>';
}
?>
<p><?php the_category(); ?><p>
<p><?php the_tags(); ?><p>
<p><small><?php the_date(); ?></small><p>
</div></li>
<hr />
<?php
}
?>
</ul>
Not sure if that will work.
From the documentation (I think this is what you want):
Customising the Results
If you wish to customise the display of your results, you must override the default template that is being used by Search & Filter:
Create a folder in your theme folder called search-filter.
Copy the file wp-content\plugins\search-filter\templates\results.php from the templates folder in to the newly created folder in your theme – wp-content\themes\your-theme-name\search-filter\results.php
From now on, Search & Filter will load this version of the template instead of its own – so you can make any customisations that are necessary.
I need to be clear on what you did. Did you follow the first section instructions on that same documentation page, as follows:
Did you also make changes to the results.php file to customize it?
If so, can I see the live page?
AnonymousInactive
Hi Ross,
I’ve experimented quite a lot, but can’t get it the way I want. A major problem is the fact the your results.php renders separate divs for each result, instead of for instance a ul with list items. How can I change it so that a ul with list items for each post is generated?
Thank you!
Boris
AnonymousInactive
I have two versions working perfectly: 1. Shortcode version using default results.php and 2. Archive version using my theme’s search.php.
What I’d like is the theme’s search.php results on the shortcode page, but I’m not sure if 1. It is possible? 2. I have the technical ability to pull it off.
I’ve been searching through documentation and forums for hours and so far all I’ve received is a serious headache. Are you able to please assist me with this? If not, is there some documentation that you can please point me to or lead me in the right direction?
Thank you for your help.
Test page: http://hasfit.com/search-test/
My search.php code:
<?php get_header(); ?>
<div id="content">
<?php get_template_part('includes/breadcrumbs'); ?>
<?php $count = 1; ?>
<?php if (have_posts()) : while ( have_posts() ) : the_post() ?>
<?php include('includes/loop.php'); ?>
<?php
if($count%3 == 0){
?>
<div class="clear"></div>
<?php
};
$count++;
?>
<?php endwhile; ?>
<div class="clear"></div>
<div class="pagination">
<?php pagination( '« prev', 'next »') ?>
</div><!-- .pagination -->
<?php else : ?>
<?php get_template_part('includes/not-found'); ?>
<?php endif; ?>
</div><!-- #content -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
AnonymousInactive
Hello,
thank you for the plugin!
I have a problem customising the results.
I use the “Using a Shotcode” display results method.
I did what you described in your documentation:
Customising the Results
If you wish to customise the display of your results, you must override the default template that is being used by Search & Filter:
Create a folder in your theme folder called search-filter.
Copy the file wp-content\plugins\search-filter\templates\results.php from the templates folder in to the newly created folder in your theme – wp-content\themes\your-theme-name\search-filter\results.php
From now on, Search & Filter will load this version of the template instead of its own – so you can make any customisations that are necessary.
Unfortunately this did not change anything. They look the same way as before.
They don´t look like the results I get when using the standard search on my template.
I would like the results to appear in the same way they appear in the standard search on my template.
When I use the display results method “As an Archive” the results look great.
But the results are on a different page and you said the Ajax is slower.
Best regards,
Georg
AnonymousInactive
I’m not using SiteOrigin PageBuilder, I’m using profitbuilder lite.
We can do something on skype, if you’ll pardon my english (I’m french).
I’ve adapted the results.php (I’ve added some margin-top:-30px everywhere) so that the results looks good.
If you could tell me how to modify the search form (maybe with some custom css ?) I think it will be OK.
AnonymousInactive
Hello Trevor,
Nothing personnal, but I really don’t like the idea to give admin rights to someone else.
I found another bug when using ajax: new articles won’t appear unless the browser’s cache is deleted.
So I guess I will have to do without it.
I think I can bypass those 2 problems if I don’t use ajax and adapt the results template so it looks good when <br> are inserted.
I’ll still have a problem with the <br> in the search form. Is it possible to modify it like the results.php file ? Could you tell me which file I need to look into ?
AnonymousInactive
Hi,
Here is the code of the archive that i use to display results (results.php):
http://pastebin.com/Gja1JtYq
and here i put a screenshot of the display results tab config:
http://www.valladolidesquelas.com/wp-content/uploads/2016/03/display_options.png
Thanks.