-
AuthorSearch Results
-
December 3, 2020 at 4:26 pm #268700
AnonymousInactiveFantastic. Yes, I do have that updated results.php in our files so I will take a look-see. Thanks so much for your response, it is helpful. Take care.
December 3, 2020 at 9:45 am #268586
TrevorParticipantThe WordPress
the_excerpt
function strips HTML from the post content, which may be why (you will see, if you examine the code in the results.php template file that function is used).A general note first:
Our plugin files are located on your server in this location:
…/wp-content/plugins/search-filter-pro
There you will find a sub-folder named
templates
and in that a file namedresults.php
.This documentation:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results
tells the user to copy that file to their child theme folder, and place it in to a sub-folder that they should name
search-filter
Note that it is always good practice to use a child theme (this is a WordPress recommendation), as it stops updates of a theme from overwriting or deleting any changes and customizations).
Similarly, if you fail to make that copy of the result.php template file and make your edits to that, then, when our plugin updates, it will overwrite the results.php file in our plugin templates folder.
Two suggestions might help.
First, depending on what you want to show in the post grid/list, you could be using our Divi Extension addon plugin. 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:
https://searchandfilter.com/documentation/3rd-party/divi/
Second, you could edit the results.php and find this line:
<p><br /><?php the_excerpt(); ?></p>
and replace it with something like:
<div><?php echo get_the_content(); ?></div>
December 1, 2020 at 5:34 pm #268441In reply to: Infinite Scroll only works after interaction
TrevorParticipantI can see nothing wrong with the form settings, nor the results.php file. Can you try disabling WPBakery Pagebuilder, and make a page with just the two shortcodes on, which is the most basic way it can be made? I have a feeling something is causing a JavaScript conflict.
Note that, when fixed and WPBakery is enabled again, if you have a problem with the Page Builder shortcodes displaying, there is a way to fix that (I showed it to another user only a few days ago).
It is late here in the UK, so any further replies will be tomorrow, sorry.
December 1, 2020 at 4:40 pm #268427In reply to: Infinite Scroll only works after interaction
TrevorParticipantCan you return results.php and the form back to their initial infinite scroll state so I can look at them that way?
December 1, 2020 at 4:23 pm #268421In reply to: Infinite Scroll only works after interaction
TrevorParticipantIn the Search & Filter -plugin folder, in the subfolder named templates, are two files. Normal pagination template is
results.php
, and there is another for infinite scroll, with a similar but different structure.Which one did you use?
Whichever one you used, you need to follow our guide when doing that:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results
The file must be renamed to either results.php or {the number of the form ID}.php
If that was not the issue, are you able to send me a live link/URL to your search page so I can take a look?
November 30, 2020 at 9:56 pm #268292
AnonymousInactiveHello
I am trying to figure out a way to hide just ONE specific category from the results on the initial page load where I am using a checkbox filter. I’ve seen the solutions/support posts to hide ALL results on initial page load, but I want everything (else) to appear when the page loads, except for just ONE specific category. If the person checks that one category, they can then reveal the items within that particular category, but initially I want the posts from that category filtered out/hidden, but the checkbox option for that category to still be visible so someone can choose it.
hope that makes sense!
November 30, 2020 at 4:33 pm #268258In reply to: Not keep same design as my post after request
TrevorParticipantYou are using our shortcode method, so some background is important for me to explain. Our plugin files are located on your server in this location:
…/wp-content/plugins/search-filter-pro
There you will find a sub-folder named
templates
and in that a file namedresults.php
.This documentation:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results
tells the user to copy that file to their child theme folder, and place it in to a sub-folder that they should name
search-filter
Note that it is always good practice to use a child theme (this is a WordPress recommendation), as it stops updates of a theme from overwriting or deleting any changes and customizations).
Similarly, if you fail to make that copy of the result.php template file and make your edits to that, then, when our plugin updates, it will overwrite the results.php file in our plugin templates folder.
Then, you edit that results.php file to make the template for the page.
The file, I think, needs this content:
<?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 this file is called directly, abort. if ( ! defined( 'ABSPATH' ) ) { exit; } if ( $query->have_posts() ) { ?> Found <?php echo $query->found_posts; ?> Results<br /> Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br /> <div class="pagination"> <div class="nav-previous"><?php next_posts_link( 'Older posts', $query->max_num_pages ); ?></div> <div class="nav-next"><?php previous_posts_link( 'Newer posts' ); ?></div> <?php /* example code for using the wp_pagenavi plugin */ if (function_exists('wp_pagenavi')) { echo "<br />"; wp_pagenavi( array( 'query' => $query ) ); } ?> </div> <?php while ($query->have_posts()) { $query->the_post(); if(class_exists('WPBMap') && method_exists('WPBMap', 'addAllMappedShortcodes')) { WPBMap::addAllMappedShortcodes(); } ?> <div><?php echo get_the_content(); ?></div> <?php } ?> Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br /> <div class="pagination"> <div class="nav-previous"><?php next_posts_link( 'Older posts', $query->max_num_pages ); ?></div> <div class="nav-next"><?php previous_posts_link( 'Newer posts' ); ?></div> <?php /* example code for using the wp_pagenavi plugin */ if (function_exists('wp_pagenavi')) { echo "<br />"; wp_pagenavi( array( 'query' => $query ) ); } ?> </div> <?php } else { echo "No Results Found"; } ?>
This assumes that post post content of these results is as you show in those rows at the bottom of the page, as my method will show all the content of those posts.
November 24, 2020 at 9:42 pm #267709
AnonymousInactiveThe load more functionality is just a script that I added to the bottom of our template override. Here is the complete code within our file at theme-name/search-filter/results.php
<?php /** * Search & Filter Pro Template Part * Results Template Override * @package Search_Filter */ if ( $query->have_posts() ) { ?> <div class="wpgood-filtered-portfolio"> <?php while ( $query->have_posts() ) { $query->the_post(); ?> <article class="wpgood-portfolio"> <a class="wpgood-portfolio-link" href="<?php the_permalink(); ?>"> <?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'portolio-thumb' ); } ?> <h3><?php the_title(); ?></h3> </a> </article> <?php } ?> <div class="pagination"> <div class="nav-previous"> <?php next_posts_link( 'Load More', $query->max_num_pages ); ?> </div> </div> <div class="wpgood-load-more"></div> </div> <?php } else { echo '<p class="wpgood-filtered-portfolio wpgood-no-results">No Results Found</p>'; } ?> <script> jQuery( document ).ready( function($) { // Load more functionality $( document ).on( 'click', '.wpgood-filtered-portfolio .pagination a', function(e) { e.preventDefault(); var targetURL = $( this ).attr( 'href' ); $( '.wpgood-load-more:last' ).load( targetURL + ' .wpgood-filtered-portfolio' ); $( '.wpgood-filtered-portfolio .pagination a:first' ).remove(); } ); }); </script>
We’re not using any translation plugins and keep our plugin list pretty lean. We do use Yoast and have readability analysis enabled. I know I get constant Yoast nags about writing in various languages, so maybe(?) what you’re seeing comes from that? But I don’t think this should make a difference. My js grabs whichever url is most recently served.
Looking forward to your thoughts and am happy to share an admin login, if it helps.
Thanks again!
November 24, 2020 at 10:36 am #267572In reply to: Exercise library
TrevorParticipantIf you have made that copy results.php file, you can see the lines of code for the text and date, and other things. Simply remove those lines.
November 23, 2020 at 2:25 pm #267511
TrevorParticipant@Yoav you may need to open a new topic so I can deal with you directly.
Sandra, I will (try to) reply to your question in this post:
With the Shortcode method, you should not be making any query, as it is designed to use two shortcodes:
1. The form shortcode
2. The results shortcodeAnd they sit on a standard page in your theme, using the default theme template. Any changes you want to make to the template should instead be made to a local (child theme) copy of our exemplar results.php file:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results
-
AuthorSearch Results
-
Search Results
-
Hello
I am trying to figure out a way to hide just ONE specific category from the results on the initial page load where I am using a checkbox filter. I’ve seen the solutions/support posts to hide ALL results on initial page load, but I want everything (else) to appear when the page loads, except for just ONE specific category. If the person checks that one category, they can then reveal the items within that particular category, but initially I want the posts from that category filtered out/hidden, but the checkbox option for that category to still be visible so someone can choose it.
hope that makes sense!