Forums Forums Search & Filter Pro Doesn't referesh

Viewing 10 posts - 1 through 10 (of 13 total)
  • Anonymous
    #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
    #62151

    From 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
    #62153

    Hi 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

    Trevor
    #62155

    This part:

    <?php query_posts($query_string . "&meta_key=premium&orderby=meta_value"); ?>
    

    Looks like it might be overriding our filter.

    Anonymous
    #62362
    This reply has been marked as private.
    Trevor
    #62379

    Hi Juan

    I think that I will have to ask Ross, the developer, to take a quick look at this thread to see if he has any ideas. He is very busy, so I am not sure when he will be able to look.

    Anonymous
    #62382

    Hi Trevor,

    As I am developing the site I have no (too much) hurry because I’ve got a lot things to do… but do not forget me 😉

    Thanks a lot!

    Ross Moderator
    #62388

    Hey 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); – changing 96 for the ID of your search form.

    https://www.designsandcode.com/documentation/search-filter-pro/action-filter-reference/#Query_Posts

    Best

    Anonymous
    #62391

    Hi 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
    #62401

    Hmm 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

Viewing 10 posts - 1 through 10 (of 13 total)