最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Hide Search Form above results

programmeradmin1浏览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.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论