0

I have a search form in the navbar. This works just fine, but when results are displayed, the search form is repeated above the results.

I would like to keep the search form in the navbar, but lose the form above the results.

If I change get_search_form() it affects both forms.

0

You can find the search form in the "search.php" file. Comment out or delete the code that looks like this one:

<header class="page-header">
<h1 class="page-title">
    <?php _e( 'Search results for:', 'twentynineteen' ); ?>
</h1>
<div class="page-description"><?php echo get_search_query(); ?></div>

If you are using a child theme and there is no "search.php" file, then copy the file from the parent theme into the child theme and delete that code. Will be great to have more details, for instance what theme are you using right now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.