Bootstrap Navbar,用于搜索带有覆盖自定义的WordPress

时间:2018-11-29 14:20:34

标签: php html wordpress bootstrap-4

任何人都请帮助在php中添加html代码。实际上,我想添加与菜单同步的搜索标签按钮。我单独使用了主题,这导致闪烁。

导航navbar-nav的php代码

<?php
        wp_nav_menu([
            'menu'             =>   'primary',
            'theme_location'   =>   'primary',
            'container'        =>   'div',
            'container_id'     =>   'WP_Bootstrap_Navwalker',
            'container_class'  =>   'collapse navbar-collapse bg-light',
            'menu_id'          =>   'main-menu',
            'menu_class'       =>   'navbar-nav ml-auto',
            'depth'            =>   2,
            'fallback_cb'      =>   'WP_Bootstrap_Navwalker::fallback',
            'walker'           =>   new WP_Bootstrap_Navwalker()
        ]);
        ?>

重叠式搜索

<div id="myOverlay" class="overlay">
  <span class="closebtn" onclick="closeSearch()" title="Close Overlay"><i class="material-icons">clear</i></span>
  <div class="overlay-content">
    <form action="<?php echo home_url( '/' ); ?>">
    <input type="hidden" value="post" name="post_type" id="post_type" />
      <input type="text" placeholder="<?php _e("Click Here to Search your Keywords","strap"); ?>" value="<?php the_search_query(); ?>" name="s">
      <button type="submit"> <i class="material-icons">search</i> </button>
    </form>
  </div>
</div>
<button class="openBtn" onclick="openSearch()"><i class="material-icons">search</i></button>

我希望他们都添加。请帮忙。

0 个答案:

没有答案