Support Forums

Hey there, it looks like you've been redirected from designsandcode.com - as you can see we have a new home - read more

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Custom Archive page results not change

Viewing 10 posts - 1 through 10 (of 12 total)
  • Rob Abrahams
    #99230

    Hi,

    I have setup a filter for my custom post type. I have also a custom page, where the results should be seen. But when I filter, the URL change correctly somthing like example.com/my_page/?_sfm_filter=test

    Settings:
    Display results method: As an archive
    Template Options: Use a custom template for results check
    Enter the filename of the custom template: achrive-my_page.php
    Set a slug: example.com/my_page/

    I know why it’s not working. I found in the documentation: When using the archive method Search & Filter uses the pre_get_posts action to modify the The Loop with your search parameters (The Loop basically is the query that fetches all your posts)

    I need to add pre_get_posts, I think. But how? Who can help me please?

    My code:
    if ( have_posts() ) :
    while ( have_posts() ) : the_post();
    // Show mesures
    ?>
    <div class=”vc_col-sm-4 wpb_column vc_column_container”>
    <div class=”vc_column-inner”>
    “>
    “>
    <h3><span><?php the_title(); ?></span></h3>

    </div>
    </div>
    <?php
    endwhile;
    else :
    echo wpautop( ‘Sorry, no posts were found’ );
    endif;

    Trevor Moderator
    #99245

    Hi

    Am I able to see this problem on a live page (URL)? If so, give me a sample search to do as well.

    Rob Abrahams
    #99247
    This reply has been marked as private.
    Rob Abrahams
    #99249

    I found the problem. When i refresh the page, it works. How solve this problem without reloading the page?

    Trevor Moderator
    #99252

    Are you using Ajax to refresh the results? Or, are you using Visual Composer?

    Rob Abrahams
    #99271

    No, I don’t use Ajax to refresh the results. No, i don’t use Visual Composer on that page.

    Have someone a example how I refresh my results with Ajax?

    Thanks!

    Trevor Moderator
    #99275
    This reply has been marked as private.
    Rob Abrahams
    #99645
    This reply has been marked as private.
    Trevor Moderator
    #99686
    This reply has been marked as private.
    Rob Abrahams
    #99714
    This reply has been marked as private.
Viewing 10 posts - 1 through 10 (of 12 total)

The topic ‘Custom Archive page results not change’ is closed to new replies.