Support » Themes and Templates » Replacing the default header (oh yes, I’ve searched)

  • Resolved clinth

    (@clinth)


    I see that people have been asking this question for months for different versions of WordPress, but lots of them are unresolved, and the ones that are either the solutions don’t work for me or don’t apply.

    Here’s the thing: My first step was to go to “Designing Headers” in the Codex, where I am told:

    ***********************************************

    To change only the header image reference, open
    the header.php template file and look for the
    styles like this:
    
    #header {
      background: url("<?php bloginfo('stylesheet_directory'); ?>/images/wc_header.jpg")
      no-repeat bottom center; }
    #headerimg  {
      margin: 7px 9px 0;
      height: 192px;
      width: 740px; }
    
    To change the image file, replace the
    "kubrickheader.jpg" with the name of the new
    graphic image you have uploaded to your site to
    replace it. If it is in a different directory,
    change that by replacing the bloginfo() tag with
    the specific address of the graphic's location.

    ***********************************************

    The problems here are manifold.

    First, I’m assuming by “header.php template file” they mean simply the “header.php” file, but this is somewhat confusing since there are in fact files listed in the theme editor that include “template.” Since such a file doesn’t show up in my list, I assumed the header.php file was the one meant.

    Which leads me to the second and most important problem, which is that the CSS ID tags given in the above text don’t exist in the default theme “header.php” file.

    So I checked in the “style.css” file. There are #header and #headerimg tags in the CSS there, so I changed the URL and size specs accordingly, then cleared my cache, and…nothing. I’ve double- and triple-checked that my image is in the images folder of the default theme. It is there.

    So my obvious question is how do I replace the standard header in WP with mine? The instructions don’t match what my files contain, and my intuition–I actually know a little about CSS and HTML–is getting me nowhere.

    Thanks,

    Clint Hayes

Viewing 15 replies - 1 through 15 (of 71 total)
  • webdressing

    (@webdressing)

    I’m assuming you’re trying to change the default theme/folder. If that’s the case then place your new header image here:

    themes > default > images

    If you name your new image kubrickheader.jpg and upload it, then it should ask you if you want to overwrite the old image, choose yes. If it doesn’t ask you to overwrite it, then check the name and extension. If you want to call the image something else (like header.gif) then you’ll need to change the name in the css file also. Make sure you clear your cache in your computer too, or it might not ‘see’ the new image. Hope that helps 🙂

    Thread Starter clinth

    (@clinth)

    Well, just for grins, I did go ahead and just rename my header graphic “kubrickheader.jpg” and uploaded it to the folder you mentioned, which is where I’d put it originally. I changed the CSS header URL back to what I think it was originally (‘images/kubrickheader.jpg’), cleared the cache, and did get something new.

    This.

    So now I’ve got my header graphic, repeating at least twice–you can see an eighth of an inch of it or so underneath the black on the left side–with the default theme black box sitting on top of it.

    This is maddening. It’s amazing that such thorough documentation could still be so unhelpful.

    Thanks for your help so far. Your further assistance will be greatly appreciated.

    Clint

    ghanshyamgadhiya

    (@ghanshyamgadhiya)

    i checked.
    just replace this line in header.php

    <!–#header { background: url(‘http://www.aliastex.com/wp-content/themes/default/images/header-img.php?upper=000000&lower=000000&#8217;) no-repeat bottom center; }

    with

    <!–#header { background: url(‘http://www.aliastex.com/wp-content/themes/default/images/kubrickheader.jpg&#8217;) no-repeat bottom center; }

    vonsomething

    (@vonsomething)

    Maddening. Agreed. I’m having a similar problem. I just switched to the default template from one which was a little closer to the end result I wanted, because it was suggested that maybe the theme I was using was complicating my attempts at customization.

    But I’m having similar problems. My header image briefly showed up, but then was gone. I too have a little experience with css, and if I struggle briefly, still get the result I want. I don’t know if it’s the PHP, or just the wordpress method of having code in so many separate files, but it’s really frustrating to spend the few hours a week I have to spend on my blog scrolling repeatedly through the same page(s) of code, making changes that don’t have the expected impact. Again I agree with Clint, there is a lot of documentation on line, but it’s self-referencing, and there are almost too many directions for each subject.

    That (rant, sorry) said, I have a similar problem with the same template, but mine doesn’t have the code ghanshyamgadh references in my header.php file(?) There seems to be a lot of code devoted to the gradient in the header in various files, but I have no idea what it’s safe to delete. I’m considering switching templates again, but my whole intent was to implement my own design by modifying a template -and switching templates is beginning to seem pointless – the default has a lot of code I don’t need, and seems to complicate editing, and the other templates may well have non-standard code that other users can’t help me with. Not sure what direction to take…

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    My advice: Write your own template. It’s not that hard. A lot of the documentation is based around what they considered to be the most commonplace stuff, but since then, a lot of templates have gone another direction.

    Thread Starter clinth

    (@clinth)

    ghanshyamgadhiya,

    Thanks for the help. The problem is that the line you suggest I replace doesn’t exist in my header.php file.

    These are the contents of my header.php file:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    
    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    
    <title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title>
    
    <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->
    
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    
    <style type="text/css" media="screen">
    
    <?php
    // Checks to see whether it needs a sidebar or not
    if ( !$withcomments && !is_single() ) {
    ?>
    	#page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbg.jpg") repeat-y top; border: none; }
    <?php } else { // No sidebar ?>
    	#page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbgwide.jpg") repeat-y top; border: none; }
    <?php } ?>
    
    </style>
    
    <?php wp_head(); ?>
    </head>
    <body>
    <div id="page">
    
    <div id="header">
    	<div id="headerimg">
    		<h1><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
    		<div class="description"><?php bloginfo('description'); ?></div>
    	</div>
    </div>
    <hr />
    csbrown

    (@csbrown)

    I just went in to look at the different themes and it changed my header. How do I get my original one back.

    Sorry I am really new at all this too.

    Csbrown

    Thread Starter clinth

    (@clinth)

    I have to say, I’m just about to dump WordPress. It may be free, but what I’d really like is an app that works, straight out of the box. I’ve tried to follow the documentation, but it’s inaccurate–that is, it tells me, for example, to change things that aren’t there–and so far the support is wanting. I’ve had some kind people offer assistance, but there needs to be someone who actually *knows how to fix stuff.* So far I’m very unimpressed. All I want is the frickin’ header graphic to work.

    vkaryl

    (@vkaryl)

    Everyone here is a volunteer. That’s it. We try to offer help as and when we can.

    Trying to tweak the “default” wp theme is an exercise in frustration. The best thing to do is go to http://themes.wordpress.net/, check off your requirements for a theme in the selection sidebar, then search on them and find a theme that meets most of your look/layout requirements.

    Tweaking most any theme from there for graphics etc. will be an infinity easier than doing same with the “default”. I’ve been using wp for 2.5 years, I develop, design, and manage websites on a daily basis, I write clean valid code, and I won’t touch kubrick with the longest pole in the universe.

    Thread Starter clinth

    (@clinth)

    vkaryl,

    Thanks for the prompt response. Sorry if I sounded a bit snippy in that last post, but I’ve been trying to fix this off and on for two months now and my frustration level is at its peak. I want to be able to tell people I’ve got my blog up and running and I can’t with it like this.

    I’ll take your advice and go the custom theme route. Thanks for that tip. I have to wonder, though, why it is that if the default theme is as inscrutable as you imply it is, why there isn’t an effort to make it easier and more accessible. The documentation, at the very least, needs work.

    I’ll let you know how it goes. Thanks again.

    Clint H.

    vkaryl

    (@vkaryl)

    I dunno Clint. I’ve been wondering about the “default theme” situation for over 2 years myself. And honestly, I don’t have a clue.

    Thing is, a lot of the themes on various theme sites started from the default, but the authors have done all the hard work for you.

    Best of luck, if you have other questions, please post back and give us another chance, ‘kay?

    [And if you’ve got a theme you like, but there are some nitty-picky-dirty-gritty things you just can’t sort, email me at vkaryl *at* bytehaven *dot* com – replacing the obvious – and I’ll do my best to help you off-list and no charge…. as long as it’s NOT kubrick! *laughing*]

    vonsomething

    (@vonsomething)

    One of the reasons I settled on WP after much internal debate is the fact that their is the support community that exists. As Clint said, it’s a free product, and while I can complain about the organization of the documentation, the fact that there is so much documentation, and so many people in these forums offering assistance (whether it results in a full-fledged resolution or not) affected my decision. I looked at every similar product available, and visited these very forums before settling on WP.

    I am having better luck with my 3rd template, but vkaryl – unfortunately there is no option for “clean valid code” when searching templates. That would be nice though. I guess it takes more research, but I have to say that WP installed easily, and has ‘managed the content’ of the site pretty much flawlessly from the start. That’s the part I wouldn’t want to face without WP.

    I’ll just have to exercise patience. Thanks to everyone who is using their time and expertise to help the WP uninitiated.

    vkaryl

    (@vkaryl)

    Heh…. yeah, “clean valid code” is a whole other animal. Now, if you get to the point where everything is “mostly” valid but you’ve got some really obscure errors, I’d be happy to help you chase them down – see email in post above – and yes, that would be free.

    ghanshyamgadhiya

    (@ghanshyamgadhiya)

    ok,

    I get this line in view source

    <!–#header { background: url(‘http://www.aliastex.com/wp-content/themes/default/images/header-img.php?upper=000000&lower=000000&#8217;) no-repeat bottom center; }

    but it is wrong it should be

    <!–#header { background: url(‘http://www.aliastex.com/wp-content/themes/default/images/kubrickheader.jpg&#8217;) no-repeat bottom center; }

    like this.

    I think you have to check your functions.php( line no 281),
    header-img.php files.

    otherwise replace them with original files.
    I just guess it.
    it may help you. 🙂

    webdressing

    (@webdressing)

    It may be free, but what I’d really like is an app that works, straight out of the box.
    What didn’t work ‘out of the box’? Chances are you’re talking about a custom theme that you’re trying to install, and you can’t blame WordPress for that. Blame the author who made the custom theme.

    for example, to change things that aren’t there
    Again, what isn’t there? WordPress documentation applies only to WORDPRESS files. Custom themes are written in PHP and HTML, and the authors of those custom themes are free to apply it as they deam necessary for that particular theme/plugin. WordPress has no control over them, just like WordPress has no control over how the end user uses their product. The bigger problem here is that you probably don’t understand how to code, but that’s really not WordPress’s problem. WordPress didn’t write the PHP scripting language, they are just using it for their product.

    there needs to be someone who actually *knows how to fix stuff.*
    People can’t be at two different places at the same time. If the coders who write WordPress code were baby sitting the forums – then they would never have any time to write the next version of WordPress. Same thing applies to those who write those great little plugins. As a coder you try to help those who don’t understand PHP, but you simply can’t design/write/test plugins and be on the forums 24/7. The only logical answer is that the members learn how to code, even on a basic level, themselves. Just think of it as an investment in your site. Its really not that hard to learn coding. In regards to having a perfect XHTML template, I really wouldn’t waste much time worrying about that. First of all I.E. (even IE7) doesn’t even support XHTML. Secondly even if you had a perfectly designed page it still wouldn’t matter that much because the very first time that someone left a < / b > tag open in a comment – then your site wouldn’t be XHTML compliant anymore. Worry about making your search engines happy. They will effect your sites success far more than valid code. Of course you always want to ‘strive’ for having as clean of code as possible, but just don’t lose any sleep over it 🙂

Viewing 15 replies - 1 through 15 (of 71 total)
  • The topic ‘Replacing the default header (oh yes, I’ve searched)’ is closed to new replies.