Last active
August 29, 2015 14:02
-
-
Save krmd/b9305547d96faaf38c24 to your computer and use it in GitHub Desktop.
WooTheme Canvas: Add Search Bar to Navigation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'woo_nav_inside', 'custom_nav_searchform', 10 ); | |
function custom_nav_searchform () { | |
echo '<div id="nav-search" class="nav-search fr">' . " | |
"; | |
get_template_part( 'search', 'form' ); | |
echo '</div><!--/#nav-search .nav-search fr-->' . " | |
"; | |
} | |
//OR | |
/* Optional Top Navigation (WP Menus) */ | |
/*-----------------------------------------------------------------------------------*/ | |
if ( ! function_exists( 'woo_top_navigation' ) ) { | |
function woo_top_navigation() { | |
if ( function_exists( 'has_nav_menu' ) && has_nav_menu( 'top-menu' ) ) { | |
?> | |
<div id="top"> | |
<div class="col-full"> | |
<?php | |
echo '<h3 class="top-menu">' . woo_get_menu_name( 'top-menu' ) . '</h3>'; | |
wp_nav_menu( array( 'depth' => 6, 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'top-nav', 'menu_class' => 'nav top-navigation fl', 'theme_location' => 'top-menu' ) ); | |
?> | |
<div id="nav-search" class="nav-search fr"> | |
<?php get_template_part( 'search', 'form' ); ?> | |
</div><!--/#nav-search .nav-search fr--> | |
</div> | |
</div><!-- /#top --> | |
<?php | |
} | |
} // End woo_top_navigation() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment