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.
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.
Share Improve this question asked Oct 15, 2019 at 22:22 StripyTigerStripyTiger 2771 silver badge6 bronze badges1 Answer
Reset to default 0You 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.