Forums › Forums › Search & Filter Pro › Search form disappear in results page
Tagged: archive, form, Results page, search
- This topic has 8 replies, 2 voices, and was last updated 5 years, 11 months ago by Anonymous.
-
Anonymous(Private) January 9, 2019 at 1:25 pm #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(Private) January 17, 2019 at 3:18 pm #199245If 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
. -
AuthorPosts