Header Image Help
-
Hi, I’m trying to add an image above my header so my site looks like:
Header Image
Blog Title
Blog Postand was following a thread but I didn’t realize I wasn’t allowed to ask questions (seriously, I’m sorry) and was told to start my own thread.
I asked my webhost to create a folder called “decode child” but now when I got to the themes on my site, it says the theme is broken and the stylesheet is missing, so I can’t add the style.css file or folder.
-
The child is activated on my site and I added the header… but it’s still below the blog title.
Hmm I double checked the coding and it reads like the header is above the blog title, but it’s not reflecting that on my blog.
Remember to flush your cache if your caching plugin is still active.
Now my site is completely blank 🙁
At least on Chrome, where I cleared my cache.
Do you see the header in the correct spot when you view it? I’ve checked on Firefox and Chrome and the header is still below the title.
I’m not seeing your child theme at all, and your caching plugin is still active. I suggest that you look into deactivating it for now.
OK, I deactivated it the plugin. Now that I’m viewing it on Firefox (I was doing it on Chrome but when I cleared the cache, it wouldn’t load the website) I’m not seeing the child either and I was on Chrome.
Is there another way to clear the cache besides from the browser settings?
OK – you seem to have misinterpreted what I said earlier. Go back into your child theme’s stylehsete and remove:
<?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"> <?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> <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> <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 --> <?php endif; ?> </header><!-- #masthead --> <div id="main" class="wrapper">Drop that whole chunk of code into a new file called header.php in your child theme. General rule of thumb: anything that has
<?phpin it belongs in a .php file and not in a style.css file. 🙂Oh man sorry! That rule of thumb makes sense! OK, going to move the code like you told me before. Question: should I delete this part:
<?php
// add any new or customised functions here
and add the code, or leave that part and add the code underneath it?
This:
<?php // add any new or customised functions hereshouldn’t be in the style.css file., If you are referring to the functions.php file, just leave it there. To clarify, once you have finished you will have:
header.php (which you will have just created)
functions.php (came with the child theme but pretty empty)
style.css (came with the theme)
screenshot.pngOK! So now the header is above the blog title AND below it (hey, progress).
Also, on my Dashboard (like the backend of the site) I can see the header…
Oh shoot, I added the header to the functions.php.
I’M SO SORRY, I’M ANNOYED AT MYSELF FOR YOU!
My next question is how do I create the header.php? (I thought I was supposed to paste it into functions.php which is obviously not the case)
The topic ‘Header Image Help’ is closed to new replies.
