-
AuthorSearch Results
-
October 22, 2020 at 12:40 pm #263728
In reply to: search results conflict with brizy template
AnonymousInactiveThanks, Trevor, for your reply.
Unfortunately it doesn’t work… something with the archive module of brizy and S&F Pro archive setting seems to be incompatible. I will ask brizy support about that.
I think I checked all kinds of settings displaying the search results in the meantime.
What is working with brizy template is using shortcode – but here the problem is that it’s not showing the content of each post on the results page (in this case the audio-players, which is essential), but the excerpts. And my knowledge to change it to the content (changing ‘the_excerpt’ to ‘the_content’ at line 60 in results.php) is not enough; after this change I got a loop in the loop and a screwed up page.
Any idea how I can do this? It good be proper workaround.Thank you.
October 20, 2020 at 1:48 pm #263495In reply to: Results markup & ACF fields customization
TrevorParticipantIn that you may want to display data from custom fields and taxonomies, the shortcode method is probably best. We are working on alternatives, but for now I think this is the way for you.
When using the Shortcode display results method, it uses a template file named results.php. You would need to customize that, as per this starter guide:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results
Is that what you needed to know?
October 15, 2020 at 4:17 pm #263014In reply to: Add search filter bar to produt grid Woocommerce
AnonymousInactiveHi Trevor,
Ok many thanks for your help. To resolve my issue, I will use the short code method and use the customization of results by modifying the results.php file (instead of enfold products grid).
Can you please tell me how to display the other products’s attributes like description and custom attributes ?Regards,
October 13, 2020 at 4:19 pm #262848In reply to: No results mesagge on infinite scroll
TrevorParticipantYou could use this alternative results.php template:
<?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 ( ! defined( 'ABSPATH' ) ) { exit; } 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 { //figure out which type of "no results" message to show $message = "noresults"; if(isset($query->query['paged'])) { if($query->query['paged']>1){ $message = "endofresults"; } } if($message=="noresults") { ?> <div class='search-filter-results-list' data-search-filter-action='infinite-scroll-end'> <span>No Results Found</span> </div> <?php } else { ?> <div class='search-filter-results-list' data-search-filter-action='infinite-scroll-end'> <span>End of Results</span> </div> <?php } } ?>
October 8, 2020 at 2:51 pm #262433
TrevorParticipantI fixed that link. Can you check/confirm that you did follow the advice there?
As to the bullet points. This theme CSS file:
https://www.hifi-advice.com/blog/wp-content/themes/theblog/style.css
On line 861 has this CSS, which is causing them:
.body-content ul > li:before { content: "\f105"; font-family: "FontAwesome"; position: absolute; left: 0; top: 5px; line-height: 1; }
Add this custom CSS to the theme customizer to fix this:
.body-content .searchandfilter ul > li:before { content: none; }
Once I have the answer to the first part of this reply, I need to see the content of the results.php file, IF you have modified it? If you did not modify it, do you have a Related Posts plugin installed (which one), as it may be automatically adding that content after the post excerpt?
October 7, 2020 at 3:47 pm #262240In reply to: Don’t Show Results Until User Clicks Submit/Search
TrevorParticipantAre you able to send me a live link/URL to your search page so I can take a look?
Which Display Results Method are you using? With some, it cannot be done, with those using a PHP template, it can, with some coding. For example, using our Shortcode method …
… in which case you should follow the ‘guide to customising’:
Once you have a copy of the results.php file in a
search-filter
sub-folder of your theme, you can edit that file, like this (leave the PHP comments at the top outside and before this code):global $searchandfilter; $sf_current_query = $searchandfilter->get(1234)->current_query(); if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) { echo '<div>Nothing to see here folks!</div>'; } else { // the current resuts.php code here }
Where the ID number in this needs to match your form ID (replace 1234). Similar code can be used in your own PHP template file.
October 7, 2020 at 1:53 pm #262213In reply to: Pagination not working
AnonymousInactiveHi Trevor, Thanks for repling
That Divi module integration didn’t exist when I set this up I don’t think.
I’ve created a new page to play with this https://www.miskinmedia.co.uk/views-digital-journalism/views-blog2/
The layout would all need styling again which is ok but the pagination still isn’t working. Clicking Older Posts just makes the page ‘fade’ with some kind of overlay.
Am I missing something simple? Would I still need to edit results.php? I didn’t edit that originally.
October 6, 2020 at 2:38 pm #262076In reply to: Search Form on Top
TrevorParticipantFor 1, you would have had to specify a template file to use.
You would need to be using a child theme. You copy that file to the child theme folder, and then edit it to add the PHP do_shortcode code as shown here:
<?php echo do_shortcode('[searchandfilter id="710"]'); ?>
You may also need to make the form horizontal, like this (change the px value to match your theme’s mobile/responsive breakpoint):
@media (min-width: 992px) { .searchandfilter[data-sf-form-id="710"] { display: inline-block; vertical-align: top; padding: 0 20px; } }
These are for guidance only. We do not include customising your theme and templates within the scope of support.
2. You wish to use the Shortcode method, but will need to create you own template. You still need to use our results.php template file, but customize it according to these instructions:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results
This is only a simple exemplar template, which uses the WordPress Codex structure and PHP.
So, what to do? You can replace almost anything you want in the file, but keep the if … else … endif and the while …. endwhile and transplant your own HTML, PHP and class names to replace our code. Do this slowly and test regularly, keeping backups at each stage.
The results.php template code will run inside your theme’s standard page template, in the content part, called by our results shortcode.
Again, we do not offer a coding service to do this, but it is fairly standard WordPress code, so you can often copy code from elsewhere in your theme.
October 6, 2020 at 12:40 pm #262046In reply to: Pagination not working
TrevorParticipantAs you are using the Shortcode method (see below about the Divi integration), it would depend on what changes you have made to the results.php template file, especially the pagination.
I am not sure if it is relevant, but you are not using our Divi Extension? I wonder if this would help (but you would need to use the Divi Blog module, which may not be suitable for you). You can find it for download (if you are logged in) at the top of this guide page:
October 6, 2020 at 10:53 am #262019In reply to: Changing results page
TrevorParticipantI think I understand. You wish to use the Shortcode method, but create you own template. You still need to use our results.php template file, but customize it according to these instructions:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results
This is only a simple exemplar template, which uses the WordPress Codex structure and PHP.
So, what to do? You can replace almost anything you want in the file, but keep the
if ... else ... endif
and thewhile .... endwhile
and transplant your own HTML, PHP and class names to replace our code. Do this slowly and test regularly, keeping backups at each stage.The results.php template code will run inside your theme’s standard page template, in the content part, called by our results shortcode.
-
AuthorSearch Results