Looking for support? You can access the support system via your account.
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, 3 months ago by Simone Montanari.
-
Simone Montanari(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 Moderator(Private) January 9, 2019 at 1:55 pm #198526Are you able to send me a live link/URL to your search page so I can take a look?
Simone Montanari(Private) January 10, 2019 at 9:10 am #198583Hi 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 Moderator(Private) January 10, 2019 at 11:08 am #198585This reply has been marked as private.Simone Montanari(Private) January 15, 2019 at 9:47 am #198932This reply has been marked as private.Trevor Moderator(Private) January 15, 2019 at 10:32 am #198934On the Display Results tab, which theme template are you using? I suspect search.php
What happens if you change this to archive.php?
Simone Montanari(Private) January 17, 2019 at 9:34 am #199188This reply has been marked as private.Trevor Moderator(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
.Simone Montanari(Private) January 18, 2019 at 9:15 am #199311Hi Trevor,
thanks a lot! That solved the problem.
Have a nice day,
Simone
-
AuthorPosts
The topic ‘Search form disappear in results page’ is closed to new replies.