WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Rarruga
    Member
    Posted 1 year ago #

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

    http://wordpress.org/extend/themes/twentytwelve/

  2. 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:

    <hgroup>
    	<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>
    </hgroup>

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

    Hope that helps.

  3. Rarruga
    Member
    Posted 1 year 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