Is it possible to add search to navbar in wordpress sparkling theme?
My site is http://www.wpfever.com.
I have tried adding the following code in header.php:
<?php get_search_form(); ?>
Replaced by the following:
<?php if ( has_nav_menu( 'main_nav' ) ) { ?>
<?php wp_nav_menu( array( 'theme_location' => 'main_nav' ) ); ?>
<?php } else { ?>
<ul><?php wp_list_pages("depth=3&title_li="); ?></ul>
<?php } ?>
I got inspired by this solution, but would select the 1st approach for simplicity:
Add this to your plugin / theme
functions.php
:Then some CSS (just added this to theme
style.css
):Your theme based on bootstrap frame work you can use this code below to show search form with menu
but if you want only show the search form only paste the below code instead the above code