Search on main navigation

Good afternoon,
First of all, thanks for your great template!

Do you know if is any way to include search plugin just after main menu on main-navigation position?

Kind regards

Hi fiber_victor,
For the default of the themes, the search form are placed in the sidebar.

regards,
Awan

Hi Awan,

Thanks for your quick reply. On the sidebar is just the position where I have it placed. Is not possible to include it on the main menu with any php custom?

Warm regard

Victor

Hi you can include your search plugin’s shortcode using this code everywhere you want in your theme

 <?php echo do_shortcode("[example_shortcode]"); ?>

Hi guys,

Finally I found the solution.

On header.php file add:


<?php get_search_form(); ?>

to the nav class main-navigation.
For example:


<nav id="site-navigation" class="main-navigation" role="navigation">
		<div class="container">
			<button class="menu-toggle btn"><i class="fa fa-bars"></i></button>
			<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
<?php get_search_form(); ?>
		</div>	

Great!

feel free to ask a question to us if you need help :slight_smile: