Twenty Twelve
[resolved] Search field in header (3 posts)

  1. Rarruga
    Posted 3 years ago #

    Is there a simple way to add a search field to the right of the site description in the header?


  2. Drew Jaynes
    Docs Czar
    Posted 3 years ago #

    Hi Rarruga,

    You could always add something like this to your header.php file:

    <div class="alignright">
    	<?php get_search_form(); ?>
    </div><!-- .alignright -->

    But you may need to finagle with the styles in the header, particularly with the site-title and site-description tags (because they extend 100% of the way across the header space.

    For example, I added the code above just below this section in header.php:

    	<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
    	<h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>

    And it looks sort of like this: http://cl.ly/image/0L2j433a3X40

    Hope that helps.

  3. Rarruga
    Posted 3 years ago #

    Thanks for the tip. Now I have to figure out how to implement this in my child theme.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic