Forums › Forums › Search & Filter Pro › Search Page Doesnt Refresh with Updated Filters
- This topic has 6 replies, 2 voices, and was last updated 4 years ago by Trevor.
-
Anonymous(Private) October 29, 2020 at 4:38 pm #264579
Hello,
My initial search via Categories and Tags provides the correct results. However, when I update the filters to something new and hit Submit, nothing happens. The address bar updates with the new filters and if I hit enter or refresh, the page then displays the correct results. Therefore, it appears something happens to my Submit button after my initial search results are displayed. I even tried the Auto Submit option and that doesnt work either.
I am currently using the theme Pluto and my Display Results option is set to “As an Archive” as using Shortcode and Template just displays everything and not any filtered results. I also tried using Custom Template and chose index.php as well as search.php and nothing changed.
I also looked into updating my search.php file to search-filter.php with deleting a line of code, but that didnt work either. I pasted a copy of my original search.php file below.
Any help would be much appreciated!
<?php
/**
* The template for displaying Search Results pages
*
* @package WordPress
* @since Pluto 1.0
*/get_header(); ?>
<div class=”main-content-w”>
<div class=”main-content-m”>
<?php os_the_primary_sidebar(‘left’); ?>
<div class=”main-content-i”>
<?php
if ( have_posts() ) : ?><header class=”search-results-header”>
<h3><?php printf( __( ‘Search Results for: %s’, ‘pluto’ ), get_search_query() ); ?></h3>
</header><!– .page-header –>
<?php osetin_show_filter_bar(‘option’); ?>
<?php require_once(get_template_directory() . ‘/inc/set-layout-vars.php’) ?>
<div class=”content side-padded-content”>
<div class=”index-isotope hidden-on-load <?php echo $isotope_class; ?>” data-layout-mode=”<?php echo $layout_mode; ?>”>
<?php
$os_current_box_counter = 1; $os_ad_block_counter = 0;
// Start the Loop.
while ( have_posts() ) : the_post();/*
* Include the post format-specific template for the content. If you want to
* use this in a child theme, then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part( $template_part, get_post_format() );os_ad_between_posts();
endwhile; ?>
</div>
<?php require_once(get_template_directory() . ‘/inc/isotope-navigation.php’) ?>
</div>
<?phpelse :
// If no content, include the “No posts found” template.
get_template_part( ‘content’, ‘none’ );endif; ?>
</div>
<?php os_the_primary_sidebar(‘right’); ?>
</div>
<?php os_footer(); ?>
</div><?php
get_footer();Trevor(Private) October 29, 2020 at 7:09 pm #264640This will be related to Ajax. The Ajax container may well require to be different (to the default
#main
), and if you want me to advise on that, are you able to send me a live link/URL to your search page so I can take a look?Also, from the code you posted, I can see that Masonry (Isotope) is being applied. If you have more than one column, it might be necessary to re-apply masonry to the posts after the Ajax results refresh, which, unless you know how your theme is doing that on page load, will be quite difficult. We have the trigger JavaScript for when to do it, but the actual code that goes in to that will be what you would need to discover.
Switching Ajax off in the form overcomes these issues of course.
Anonymous(Private) October 30, 2020 at 11:40 am #264719Hi Trevor,
My live search results url is https://journeyer.io/search-results/.
Let me play around with the Ajax settings in the S&F Settings.
Thanks!
-
AuthorPosts