Forums › Forums › Search & Filter Pro › Doesn't referesh
- This topic has 12 replies, 3 voices, and was last updated 8 years, 3 months ago by Anonymous.
-
Anonymous(Private) October 5, 2016 at 11:25 am #62146
Hi!
I’m developing a site using your plugin (Pro version) in a local machine.
I’ve added a form in category.php to filter the results with customs fields and several Post Types.
It seems that everything is configured and working fine but… when results must be shown, I get the same the full list of category archive.
The window scrolls to configured container and turn it transparent for a moment and then nothing happens.Any ideas?
Thank you!
rgds
Trevor(Private) October 5, 2016 at 12:02 pm #62151From what you say I cannot see the page as it is on localhost. Two things I would suggest. Make sure the Results Container is et correctly. The default is
#main
but that often has to be changed. Whatever container you use, it MUST NOT also contain the search form. You can use a class instead of ID, in case precede it with a period, e.g..results
Second, make sure that there are no javascript errors. In Chrome, use the page inspector and open the console tab and look there.
Anonymous(Private) October 5, 2016 at 12:22 pm #62153Hi Trevor,
My code:
<div id="results"> <?php query_posts($query_string . "&meta_key=premium&orderby=meta_value"); ?> <?php while (have_posts() ) : the_post(); ?> <div class="<?php if (get_field('premium')) { echo 'premium'; } ?> row-fluid padM marginDownS bRadiusM brightenCat resumenFicha"> <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"> <div class="col-md-4 col-sm-6 col-xs-2 erasePad"> <?php the_post_thumbnail( 'medium', array('class' => 'img-responsive bRadiusM')); ?> </div> <div class="col-md-8 col-sm-6 col-xs-10"> <h4 class="text-left secondColor textSizeM"> <?php if (in_category (array ('playas', 'municipios'))): ?> <?php the_title(); ?> <?php else: ?> <?php the_title(); ?> <?php endif ?> </h4> <p class="textSizeS mainColor esconder_xs"> <?php the_field('ciudad'); ?> <?php the_field('cul_ciudad'); ?> <?php the_field('en_municipio'); ?> <?php the_field('rut_salida'); ?> <?php the_field('pn_municipios'); ?> </p> <div class="esconder_xs"> <?php the_excerpt(array('class' => 'greyFont')); ?> </div> </div> </a> </div> <?php endwhile;?> <div id="pagination"> <?php wp_pagenavi( ); ?> </div> </div>
#results is set to “result container”.
And there are no javascripts errors… only two 404 getting a old image.
Thanks
rgds
Ross Moderator(Private) October 6, 2016 at 9:58 am #62388Hey Juan
This line will definitely override our results:
query_posts($query_string . "&meta_key=premium&orderby=meta_value");
Actually, it looks like a way to add ordering to the existing query – by creating a second query on the page (because WP already does one automatically) – its pretty inefficient.
Anyway, back to the code.
If you remove the line above you’ll have a template in the right format for Archive display mode, but if the results are still not updating then you can make S&F run a query – so replace the above
query_posts()...
with:do_action('search_filter_query_posts', 96);
– changing96
for the ID of your search form.https://www.designsandcode.com/documentation/search-filter-pro/action-filter-reference/#Query_Posts
Best
Anonymous(Private) October 6, 2016 at 10:53 am #62391Hi Ross,
Thank you for your quick response.
I deleted this query:
query_posts($query_string . "&meta_key=premium&orderby=meta_value");
and if I have replaced it whit:
do_action('search_filter_query_posts', 29249);
as follows:
<div id="results"> <?php do_action('search_filter_query_posts', 29249);?> <?php while (have_posts() ) : the_post(); ?> ... <?php endwhile;?> <div id="pagination"> <?php wp_pagenavi( ); ?> </div> </div>
Right?
But nothing happens…
thank you in advance
Ross Moderator(Private) October 6, 2016 at 12:44 pm #62401Hmm very strange…
As a test what happens when you replace the same line with:
query_posts(array("post_type" => "page"));
?
Search & Filter won’t be working, but you should see the results from that template will show only
pages
… Can you let me know if this is what you see?I’ve just read up a bit too.. I missed a trick I think, can you disable Ajax while we test these loops etc?
Thanks
-
AuthorPosts