Forums Forums Search & Filter Pro Show results on same page + filters not working

Viewing 10 posts - 1 through 10 (of 38 total)
  • Trevor
    #185290

    From the settings, it looks like the site is on a local install, so I cannot see it working. Is that correct?

    From what you describe, it looks like the Ajax Container settings (which is currently set to #main I can see from your screenshots) is wrong. #main is the standard container name for a list of archives results (as per the WordPress Codex), but my guess is your theme uses something else.

    If I could see the site live, then I could advise you better.

    Anonymous
    #185300

    Hello Trevor!

    You’re correct about the local installation, I’m heading to work right now and can set it online on the next hours.

    About the #main, it’s the same ID on my current installation.

    I’ll keep in touch.

    Anonymous
    #185405
    This reply has been marked as private.
    Trevor
    #185454
    This reply has been marked as private.
    Anonymous
    #185456
    This reply has been marked as private.
    Trevor
    #185468

    Ok, I have revealed the counts for now and enabled Auto Count (for the counts to work).

    Did you add some code so that the ones you select switch to the top of the list?

    Can you try this with Ajax off for now? If that works, try it with normal pagination (not infinite scroll).

    Anonymous
    #185478

    Trevor, thank you for the response!

    Yes, I added this css so the designer could stay in peace as now he knows this is possible (put selected items on top)

    I disabled Ajax and things started to work a little bit more as expected, without Ajax infinite scrolling won’t work, right? Can we make it work with Ajax?

    Trevor
    #185497

    It will be the template code for that page that is causing it not to work, most likely using either query_posts or pre_get_posts, which is overriding our filter. If this is the case, a way around this is to use the Custom display method, described here:

    https://searchandfilter.com/documentation/search-results/custom/

    Anonymous
    #185503

    Trevor, you mean the archive.php file?

    We use Auttomatic’s Underscores as base, so I believe it’s using the most “stick to the codex” code, right?

    In our case, archive.php gives this code between get_header() and get_sidebar()/get_footer():

    <main id="main" class="site-main">
    
    		<?php if ( have_posts() ) : ?>
    
    			<header class="page-header">
    				<?php
    				the_archive_title( '<h1 class="page-title">', '</h1>' );
    				the_archive_description( '<div class="archive-description">', '</div>' );
    				?>
    			</header><!-- .page-header -->
    
    			<?php
    			/* Start the Loop */
    			while ( have_posts() ) :
    				the_post();
    
    				/*
    				 * Include the Post-Type-specific template for the content.
    				 * If you want to override this in a child theme, then include a file
    				 * called content-___.php (where ___ is the Post Type name) and that will be used instead.
    				 */
    				get_template_part( 'template-parts/content', get_post_type() );
    
    			endwhile;
    
    			the_posts_navigation();
    
    		else :
    
    			get_template_part( 'template-parts/content', 'none' );
    
    		endif;
    		?>
    
    		</main><!-- #main -->
    Trevor
    #185505

    It depends what is going on in this part:

    get_template_part( 'template-parts/content', get_post_type() );
    
Viewing 10 posts - 1 through 10 (of 38 total)