Problems placing Menu and Header Image
-
Hi everyone!
I have a little problem with my layout…
When I place an header image, it comes bellow the main menu.
I would like to place the menu and search field underneath the header image.
I tried to “change positions” of both items on the header.php file, but it didn’t work. I tried several different configurations but everytime I changed the positions, there was a different problem, image or menu was placed on an unexpected place.
As I don’t know almost anything about CSS or PHP, I am finding a lot of diffifulty doing this.
This is my blog: https://exquisite.style
This is how things look on the original theme (without header image): https://blogum.wpshower.com/
And this is my header.php as it is configured now:
The header image is correctly located, and there are two menus, one correctly aligned but on top of the header image, and the menu & search field which are bellow header image are not alligned to their original place.
<body <?php body_class(); ?>> <div class="wrapper"> <?php do_action( 'before' ); ?> <header id="header" role="banner"> <hgroup> <h4 id="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></h4> <?php if ( '' != get_bloginfo( 'description' ) ) : ?> <h2 id="site-description"><?php bloginfo( 'description' ); ?></h2> <?php endif; ?> </hgroup> <div class="clear"> <h3 id="access" class="clear" role="navigation"> <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?> </h3><!-- end #menu --> <?php get_search_form(); ?> </div> </header> <?php // Do we have a header image around? if ( '' != get_header_image() ) : ?> <div id="header-image"> <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" /></a> </div> <?php endif; ?> <div class="clear"> <h3 id="access" class="clear" role="navigation"> <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?> </h3><!-- end #menu --> <?php get_search_form(); ?> </div> <div class="middle clear">
Whereas this is the original header.php file:
body <?php body_class(); ?>> <div class="wrapper"> <?php do_action( 'before' ); ?> <header id="header" role="banner"> <hgroup> <h4 id="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></h4> <?php if ( '' != get_bloginfo( 'description' ) ) : ?> <h2 id="site-description"><?php bloginfo( 'description' ); ?></h2> <?php endif; ?> </hgroup> <div class="clear"> <h3 id="access" class="clear" role="navigation"> <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?> </h3><!-- end #menu --> <?php get_search_form(); ?> </div> </header> <?php // Do we have a header image around? if ( '' != get_header_image() ) : ?> <div id="header-image"> <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" /></a> </div> <?php endif; ?> <div class="middle clear">
As you see, I am doing a lot of messy things… ??
If anyone can help me with this, I thank you so so much! It’s such a small thing but it means a lot to me.
Thank you guys!
- The topic ‘Problems placing Menu and Header Image’ is closed to new replies.