-
Search Results
-
Hi,
I followed this page – https://searchandfilter.com/documentation/search-results/using-a-shortcode/- step by step, and can’t seem to get my results to use the new results.php file. I did notice that it says /search-filter/ and not /search-filter-pro/ and tried both variations but it didn’t work either way.Hi!
I’m using the display as shortcode option, and have copied the results.php into /child-theme/search-filter/ folder.
The temple override shows title, etc. But I cannot seem to show custom meta.
I’m trying to display the product price.
I have tried quite a few variations of methods – using globals with get_post_meta, get_the_ID, $product/$post->get_id(), etc. Pretty much every variant I could find/know already.
My last guess is that the $query being referenced, has an issue.
Please can you help?
Topic: grid results / thumbnails
Hello,
I use your plugin for the homepage of my website:
You helped me to configure the presentation of this page: https://www.filmspourenfants.net/
(See topic: https://support.searchandfilter.com/forums/topic/show-results-in-grid/)I see a problem, the images that appear in grid (thumbnails) are actually very large and therefore take time to load.
Example with the film Silent Voice :

The image come from the url:
https://www.filmspourenfants.net/wp-content/uploads/2018/10/silent-voice-a.jpg
instead of this one:
https://www.filmspourenfants.net/wp-content/uploads/2018/10/silent-voice-a-183×250.jpgwhich is available on this page as thumbnails:
https://www.filmspourenfants.net/silent-voice/Can you please help me use the urls small thumbnails rather than large images?
As a reminder, here is the code of my results.php file:
<?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() ) { ?> <div class="gp-blog-wrapper gp-blog-columns-6"> <div class="gp-inner-loop ajax-loop"> <?php while ($query->have_posts()) { $query->the_post(); ?> <section class="gp-post-item post-<?php get_the_id();?> post type-post format-standard has-post-thumbnail category-post-formats" itemscope="" itemtype="http://schema.org/Blog"> <div class="gp-post-thumbnail gp-loop-featured"> <div class="gp-image-above"> <a href="<?php the_permalink(); ?>"> <?php if ( has_post_thumbnail() ) { the_post_thumbnail("small", array('class' => 'gp-post-image gp-large-image')); the_post_thumbnail("thumb", array('class' => 'gp-post-image gp-mobile-image')); } ?> </a> </div> </div> <div class="gp-loop-content gp-image-above"> <h2 class="gp-loop-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <div class="gp-loop-cats"> <?php echo get_the_term_list( get_the_id(), 'gp_hubs', '', ' ', '' ); ?> </div> </div> </section> <?php } ?> </div></div> Page <?php echo $query->query['paged']; ?> sur <?php echo $query->max_num_pages; ?><br /> <div class="pagination"> <div class="nav-previous"><?php next_posts_link( 'Page suivante', $query->max_num_pages ); ?></div> <div class="nav-next"><?php previous_posts_link( 'Page précédente' ); ?></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 "Aucun résultat"; } ?>Topic: modify $query
I would like the results of a term of this taxonomy to always be displayed when selecting a term from my own taxonomy.
Example:
Taxonomy: Regions
Terms: Austria, Vienna, Salzuburg etc.
Articles with the term “Austria” should always be displayed if one of the other terms is selected.For the taxonomy archive page I have added the following to the “functions.php”:
function my_modify_main_query( $query ) { if ( !is_admin() && $query->is_main_query() ) { $query->set( 'tax_query', array( 'relation' => 'OR', array( 'taxonomy' => 'region', 'field' => 'slug', 'terms' => 'Österreich' ), ) ); } } add_action( 'pre_get_posts', 'my_modify_main_query' );Unfortunately this does not affect the result of “Search & Filter”. I use the shortcode method for display and in the file “results.php” the element “$query” is actually addressed as well.
Any approach on how to get my behavior realized?