Hide Search Form above results

admin2025-04-19  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.

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 badges
Add a comment  | 

1 Answer 1

Reset to default 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.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745077801a283670.html

最新回复(0)