Hi all! I’m trying to put my search box in my nav bar. (theme: Twenty Twelve Child, URL: http://reddoorreview.com )
It looks like HaHaYouSuck’s code is perfect, but I can’t seem to figure out the best place to plug it in.
<div class="alignright" margin= "1rem"> <?php get_search_form(); ?> </div><!-- .alignright --> <!--end addition of search bar in header -->
Here’s the code I want to plug it into, in the file: reddoorreview.com/wp-content/themes/twentytwelvechild/header.php
<nav id="site-navigation" class="main-navigation" role="navigation"> <h3 class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></h3> <a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentytwelve' ); ?>"> <?php _e( 'Skip to content', 'twentytwelve' ); ?></a> <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?> </nav><!-- #site-navigation -->
However, if I place it just above
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
then the search bar appears above the nav bar. If I post it below that same line of code, it’s below the nav bar.
I’ve searched other files and am coming up empty-handed. Suggestions?
(I also tried the suggestions Alchymyth put forward and neither worked for me. I also searched Google and the forums and didn’t see an answer for the Twenty Twelve theme. If there is an answer posted about this, I’m very sorry I didn’t find it.)
- The topic ‘Move Search Box to Nav Bar in Twenty Twelve Child Theme’ is closed to new replies.