Forums › Forums › Search & Filter Pro › No results filter not working
Tagged: No results
- This topic has 14 replies, 2 voices, and was last updated 3 years, 11 months ago by Trevor.
-
Anonymous(Private) November 8, 2020 at 6:02 pm #265559
Hi,
i don’t know what i’m doing wrong. Filtering for climbing locations, types,…
Custom post type -> tour
I have 5 search fields (search input, select fields for land, country, mountains, type and the submit button. All the fields are categories. Land (parent category) has land (subcategories) and land has subcategory country/region
Search section:
search field | Land | Country/Region | Mountains | Type | Submit buttonExample:
Land (parent cat) -> Austria (sub cat)
|-> Salzburg (sub sub cat)My template: archive-tour.php
<div class="filter mb-8"> <?php echo do_shortcode('[searchandfilter id="25"]'); ?> </div> <div id="main" class="mt-12"> <?php $args = array('post_type' => 'tour'); $args['search_filter_id'] = 25; $query = new WP_Query($args); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php endwhile; else : ?> <p><?php esc_html_e( 'Sorry, no posts matched your criteria.' ); ?></p> <?php endif; ?> </div>
S&F Settings:
-> Post type archiveTemplate Options: … disabled
Ajax: all three checkbox enabled
all published posts displayed, when i try to filter, page are reload but nothing change. The select fields not saved and all posts are displayed
thanks
Trevor(Private) November 10, 2020 at 10:57 am #265759I think that I see the issue. You cannot use Category more than once in the form. This video may help (made for a different user):
https://www.screencast.com/t/j8IUFm20
That Hipster term seemed to have 12 posts, but in fact had none! Something wrong with my posts (too much of me playing on a development site).
I apologize for the sound and presentational quality. It was early in my morning, so I was not fully awake!
-
AuthorPosts