Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

Search in secondary menu/page title question

Home / Forums / Virtue Theme / Search in secondary menu/page title question

This topic is: Resolved
[Resolved]
Posted in: Virtue Theme
February 18, 2018 at 4:39 am

Hi,
I have two questions: First, how can I get a pop up search into the secondary menu, preferable without the icon but with the word “Search” that opens into the searchbox pop up? I had tried using this code

add_filter('wp_nav_menu_items', 'kt_add_search_form_to_menu', 10, 2);
function kt_add_search_form_to_menu($items, $args) {

if( !($args->theme_location == 'secondary_navigation') )
return $items;
ob_start();
?>
<li class="menu-search"><?php get_search_form(); ?></li>
<?php $output = ob_get_contents();
ob_end_clean();
return $items . $output;
}

but I got a white screen.

And my second question: Can I remove the regular page title and put it into the sidebar? So far my only solution was to create multiple sidebars and assign one of them to each page ad add the title there, but this is probably not the best way…

  • The forum ‘Virtue Theme’ is closed to new topics and replies.