Forums Forums Search & Filter Pro Search form disappear in results page

Viewing 9 posts - 1 through 9 (of 9 total)
  • Anonymous
    #198520

    Hi there,

    I’m setting up Search & Filter Pro plugin fo a project.

    I set my search form to show results as an Archive and now I’m developing the results page.

    I’d like to keep the search form always visible also in the result page, so that the user can try different combinations of options.

    I inserted the form in my search result template using the shortcode. Unfortunately whenever I hit the search button the form will disappear from the page.

    Could you check if there’s something wrong in my code? Or if I’m missin something?

    <section id="primary" class="content-area">
    		<main id="main" class="site-main">
                
                <header class="page-header">
    				<h1 class="page-title">
    					<?php
    					/* translators: %s: search query. */
    					printf( esc_html__( 'Cerca il tuo viaggio', 'insolita' ), '<span>' . get_search_query() . '</span>' );
    					?>
    				</h1>
    			</header><!-- .page-header -->
                
                <div class="page-content">
                    <?php _e('<p>Ecco un prezioso strumento per cercare il tuo viaggio di gruppo perfetto!</p><p>Non dovrai più perdere ore a districarti tra le varie proposte di viaggio per scovare quello che più si adatta a te: bastano pochi minuti e avrai le nostre migliori proposte in linea con i tuoi gusti.</p><p>Insolita Itinera organizza propri viaggi di gruppo esclusivi, ma seleziona anche le proposte dei migliori operatori italiani ed esteri, per offrirti sempre la massima qualità e la miglior garanzia di un viaggio sicuro.</p>') ?>
                </div>
                
            <?php
                
            echo do_shortcode('[searchandfilter slug="ricerca-viaggio"]'); ?>
                
    
    		<?php if ( have_posts() ) : ?>
    
    			<?php
        
    			/* Start the Loop */
    			while ( have_posts() ) :
    				the_post();
    
    				get_template_part( 'template-parts/content', 'travel' );
    
    			endwhile;
    
    			the_posts_navigation();
    
    		else : 
                
                _e( '<div>No results message</div>', 'insolita' );
                
    		endif; ?>
    
    		</main><!-- #main -->
    	</section><!-- #primary -->
    Trevor
    #198526

    Are you able to send me a live link/URL to your search page so I can take a look?

    Anonymous
    #198583

    Hi Trevor,

    thanks for your reply. At the moment I’m working locally so I don’t have a live link.

    Any other way you can help me?

    Thanks a lot,

    Simone

    Trevor
    #198585
    This reply has been marked as private.
    Anonymous
    #198932
    This reply has been marked as private.
    Trevor
    #198934

    On the Display Results tab, which theme template are you using? I suspect search.php

    What happens if you change this to archive.php?

    Anonymous
    #199188
    This reply has been marked as private.
    Trevor
    #199245

    If the code in your first post is that template, find these two lines:

     echo do_shortcode('[searchandfilter slug="ricerca-viaggio"]'); ?>
                
    
    		<?php if ( have_posts() ) : ?>

    And make it like this:

     echo do_shortcode('[searchandfilter slug="ricerca-viaggio"]'); ?>
        <div class=search-filter-results">            
    
    		<?php if ( have_posts() ) : ?>

    Then this line:

    		</main><!-- #main -->
    

    becomes

    		</div></main><!-- #main -->
    

    Then find the Ajax Container setting and make it:

    .search-filter-results

    Your screenshot shows it currently set to the default #main.

    Anonymous
    #199311

    Hi Trevor,

    thanks a lot! That solved the problem.

    Have a nice day,

    Simone

Viewing 9 posts - 1 through 9 (of 9 total)