I just found this php function to add a search box on the menu (navigation bar) of my website. I am new to php and got the function to work but how could I move it to the very right of my menu bar? Right now the function adds a menu tab and places the box there. Should I use CSS or modify the function itself?
add_filter('wp_nav_menu_items','add_search_box', 10, 2);
function add_search_box($items, $args) {
ob_start();
get_search_form();
$searchform = ob_get_contents();
ob_end_clean();
$items .= '<li>' . $searchform . '</li>';
return $items;
}
Open the file:
http://mamou-mani.com/wp-content/themes/modularity/style.css
Change
to