我正尝试在主题php文件的导航中插入搜索栏。
虽然我对几乎任何样式的外观都感到满意,但我无法使表格实际出现在正确的位置。当我将其插入page.php文件中时,它会显示,但不会显示在菜单中。
我已经找到了php文件并阻止了将其正确插入的位置,但是每次我尝试插入
<?php get_search_form(); ?>
它坏了,我得到了死亡的白屏。我曾尝试过多个地方,但无济于事。
我当前正在使用覆盖居中的菜单选项,该选项位于此块中。
我试图将其插入三行菜单的左侧。
任何帮助都会很棒。
/**
* Overlay menu
* */
case 'menu-overlay':
case 'menu-overlay-center':
$overlay_animation = ot_get_option( 'menu_overlay_animation');
if ($overlay_animation === '' || $overlay_animation === '3d') $overlay_animation = 'contentscale';
$this->html = '<div class="overlay overlay-'.$overlay_animation.' style-'.$styleoverlay.'-bg overlay-menu" data-area="menu" data-container="main-container">
<div class="main-header">
<div class="vmenu-container menu-container style-'.$styleoverlay.$menu_no_arrow.$stylemaincombo.'">
<div class="row row-parent">
<div class="row-inner">
<div class="menu-sidebar main-menu-container">
<div class="navbar-main">
<div class="menu-sidebar-inner">
'.wp_nav_menu( array(
"menu" => $primary_menu,
"theme_location" => "primary",
"container" => "div",
"container_class" => "menu-accordion",
"menu_class" => "menu-primary-inner menu-smart".(is_rtl() ? ' sm-rtl' : '')." sm sm-vertical",
"fallback_cb" => false,
"walker" => new wp_bootstrap_navwalker(),
"echo" => 0)
);
if ($search !== '' && ($type === 'menu-overlay' || $type === 'menu-overlay-center'))
$this->html .= $search;
if ($no_secondary !== 'on')
$this->html .= wp_nav_menu( array(
"menu" => $secondary_menu,
"theme_location" => "secondary",
"container" => "div",
"items_wrap" => '<ul id="%1$s" class="%2$s">%3$s</ul>',
"container_class" => "menu-accordion",
"menu_class" => "menu-smart".(is_rtl() ? ' sm-rtl' : '')." sm sm-vertical",
'fallback_cb' => false,
"walker" => new wp_bootstrap_navwalker(),
"echo" => 0)
);
$this->html .= '</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="mmb-container mmb-container-overlay mobile-hidden tablet-hidden"><div class="mobile-menu-button menu-button-overlay '.$buttonstyle_primary. ' lines-button x2 overlay-close" data-area="menu" data-container="main-container"><span class="lines"></span></div></div>';
break;