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

php - Help me understand how Search function works using dynamic_sidebar()

programmeradmin3浏览0评论

On my existing website, there is a search box at the top of the page.

My understanding is that it's from this code in header.php

<div id="search_sec">
   <?php dynamic_sidebar('search');?>
</div>

which, as I understand, calls a sidebar that is registered in functions.php

register_sidebar(array(
    'id' => 'search',
    'name'=>'Search',
    'before_widget' => '',
    'after_widget' => '',
    'before_title' => '',
    'after_title' => ''
    )
);

But these lines are only for displaying stuff and does not contain anything that actually calls a search function, presumably at searchform.php

Can you please help me understand the connection from header.php to searchform.php?

Furthermore, if I rename the sidebar ID from "search" to "search1" and call dynamic_sidebar("search1"), nothing is displayed. Am I missing something?

Thanks for your help!

发布评论

评论列表(0)

  1. 暂无评论