• Hello!

    I’m really new to coding, so bear with me. I’m trying to add a search box in my menu/navigation bar on my site at kimberlyfayereads.com. I know enough to know I need to add a string of code into my header.php file, but I can’t figure out where to put it. Through other searches I’ve found the code most frequently mentioned is <?php get_search_form();?>. I’ve successfully added it to various areas in my header, but it’s not showing up where I want, which is to the right of the text on the menu bar.

    My header.php code is below. If anyone can help me with where to place this code so it shows up properly (to the right of the text), I’d appreciate it!

    <?php
    /**
     * The header for the theme.
     *
     * Displays all the <head> content, logo, and menus. Ends with <div id="content">
     *
     * @package   tweakme2
     * @copyright Copyright (c) 2015, Ashley Evans
     * @license   GPL2+
     */
    
    global $creative_whim; ?>
    
    	<!doctype html>
    
    <html <?php language_attributes(); ?> class="<?php echo apply_filters( 'tweakme2/html-class', 'no-js' ); ?>">
    
    	<head>
    		<meta charset="utf-8">
    		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    
    		<meta name="viewport" content="width=device-width">
    
    		<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
    
    		<!-- wordpress head functions -->
    		<?php wp_head(); ?>
    		<!-- end of wordpress head -->
    
    	</head>
    
    <body <?php body_class(); ?>>
    
    <?php do_action( 'tweakme2/after-body' ); ?>
    
    <div id="wrap">
    
    <?php
    $layout        = $creative_whim['header_layout']['enabled'];
    $page_template = get_page_template_slug();
    
    if ( $page_template != 'template-landing.php' ) {
    	foreach ( $layout as $key => $value ) {
    		switch ( $key ) {
    
    			// Menu #1
    			case 'menu_1' :
    				tweakme2_get_navigation( 1 );
    				break;
    			// Header Image
    			case 'header' :
    				?>
    				<header role="banner" id="top-header" class="text-center">
    					<?php
    					// Text header
    					if ( $creative_whim['header_type'] == 'text' ) {
    						?>
    						<h1 id="logo">
    							<a href="<?php echo esc_url( get_bloginfo( 'url' ) ); ?>"><?php echo get_bloginfo( 'name' ); ?></a>
    						</h1>
    						<?php
    						if ( $creative_whim['show_tagline'] == 1 ) {
    							?>
    							<h2 id="tagline"><?php echo get_bloginfo( 'description' ); ?></h2>
    							<?php
    						}
    					} // Image header
    					elseif ( ! empty( $creative_whim['header_image']['url'] ) ) {
    						?>
    						<div class="<?php echo $creative_whim['header_alignment']; ?>">
    							<a href="<?php echo esc_url( get_bloginfo( 'url' ) ); ?>"><img src="<?php echo esc_url( apply_filters( 'tweakme_header_image', $creative_whim['header_image']['url'] ) ); ?>" alt="<?php echo esc_attr( strip_tags( get_bloginfo( 'name' ) ) ); ?>"></a>
    						</div>
    						<?php
    					}
    					?>
    				</header>
    				<?php
    				break;
    
    			// Menu #2
    			case 'menu_2' :
    				tweakme2_get_navigation( 2 );
    				break;
    			// Hook
    			case 'hook' :
    				do_action( 'tweakme2/header-hook' );
    				break;
    
    		}
    	}
    }
    ?>
    
    	<div id="content" class="container">
    
    <?php do_action( 'tweakme2/inside-content-top' ); ?>

    Thank you in advance!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Add a search box in navigation bar’ is closed to new replies.