Twenty-Twelve child theme – header image problems
-
I have two problems. I am using the Twenty Twelve theme and working with a child theme. I tried following the instructions at http://wordpress.org/support/topic/move-menu-below-banner?replies=2 for moving the menu below the header (banner) but they didn’t work. I can’t even get the header to show up. This is what my header.php file says:
<?php if ( get_header_image() ) : ?> <a href="http://www.marycwaters.com/"> <img class="header-image" width="940" height="244" alt="" src="http://69.89.31.194/~marycwat/wp-content/uploads/2013/11/01-keyboardhands-manuscript-hands-green2.jpg"></img> <?php endif; ?> </header>
Once I get the header to show up, I would like to move the menu below it. I would appreciate your help Thank you. – Mary
-
That link you referenced is about a different theme – you can’t usually copy code from one theme to another. Try this thread for what you are trying to do:
Thank you very much. I thought that the link might be from a different theme, but when people don’t specify the theme they are referring to, it’s anybody’s guess. I will definitely try the thread you recommended, but first I need to know how to get the header image to show up. What am I doing wrong with the html? Here is a more complete excerpt from the header file in the child theme:
<nav id="site-navigation" class="main-navigation" role="navigation"> <h3 class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></h3> <a href="#content">"><?php _e( 'Skip to content', 'twentytwelve' ); ?></a> <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?> </nav><!-- #site-navigation --> <?php if ( get_header_image() ) : ?> <a href="http://www.marycwaters.com/"> <img class="header-image" width="940" height="244" alt="" src="http://69.89.31.194/~marycwat/wp-content/uploads/2013/11/01-keyboardhands-manuscript-hands-green2.jpg"></img> <?php endif; ?> </header><!-- #masthead -->
Thank you.
people don’t specify the theme they are referring to, it’s anybody’s guess
Look at that thread again – at the top of it, it says:
WordPress › Support » Themes and Templates
Yoko
move menu below banner (2 posts)That “Yoko” is the theme.
What am I doing wrong with the html?
You did not move that piece of php code to the place described in the thread – you are only moving this part:
<nav id="site-navigation" class="main-navigation" role="navigation"> <h3 class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></h3> "><?php _e( 'Skip to content', 'twentytwelve' ); ?> <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?> </nav><!-- #site-navigation -->
To just above this line:
</header><!-- #masthead -->
BTW, could you be sure to use the code buttons when posting code here?
Sorry, I didn’t know about the code button. I’ve posted my entire header file in pastebin. It’s at http://pastebin.com/RF0b8cbt. I haven’t moved the code around yet because I want to get the banner to show up first. I wonder if I have to reference the twentytwelve-child directory in the header file someplace. Thank you.
I wonder if I have to reference the twentytwelve-child directory in the header file someplace.
No, if you have a header.php file in the child theme folder, that’s the one the site uses. Try using this in the child theme header.php file:
<?php /** * The Header template for our theme * * Displays all of the <head> section and everything up till <div id="main"> * * @package WordPress * @subpackage Twenty_Twelve * @since Twenty Twelve 1.0 */ ?><!DOCTYPE html> <!--[if IE 7]> <html class="ie ie7" <?php language_attributes(); ?>> <![endif]--> <!--[if IE 8]> <html class="ie ie8" <?php language_attributes(); ?>> <![endif]--> <!--[if !(IE 7) | !(IE 8) ]><!--> <html <?php language_attributes(); ?>> <!--<![endif]--> <head> <meta charset="<?php bloginfo( 'charset' ); ?>" /> <meta name="viewport" content="width=device-width" /> <title><?php wp_title( '|', true, 'right' ); ?></title> <link rel="profile" href="http://gmpg.org/xfn/11" /> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" /> <?php // Loads HTML5 JavaScript file to add support for HTML5 elements in older IE versions. ?> <!--[if lt IE 9]> <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script> <![endif]--> <?php wp_head(); ?> </head> <body <?php body_class(); ?>> <div id="page" class="hfeed site"> <header id="masthead" class="site-header" role="banner"> <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> <?php if ( get_header_image() ) : ?> <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php header_image(); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /></a> <?php endif; ?> <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 --> </header><!-- #masthead --> <div id="main" class="wrapper">
BTW, do you have the child theme ACTIVE on your site?
Thank you so much for your ongoing support. Yes, I do have the child them ACTIVE on my site. The files I have for the theme are functions.php, header.php, style.css, and screenshot.png (the latter just an image that says Twenty Twelve Child Theme). I used the text you gave me for the header file and the banner still doesn’t show up. The link to my site is marywaters.com
Wait – I just checked and noticed that the header I had selected somehow “fell off” so I have to re-select it. M
You solved the problem! The header shows up and the menu is beneath it. I am very appreciative.
Cool :)! Happy to help!
- The topic ‘Twenty-Twelve child theme – header image problems’ is closed to new replies.