Need help? Check out our Support site, then


How to Override Hardcoded Uploaded Header Image?

  1. It would appear that if I upload a custom logo (header image) through WP's dynamic styling feature, the url of that image gets hardcoded somewhere in the loop but I can't figure out where!

    Here is the relevant portion of my header.php:
    `<br /> <div id="main_container"><br /> <div id="decoys"></div><br /> <div id="header"><br /> <div id="masthead"><br /> <div id="branding"><br /> <div id="blog-title"><br /> <span><br /> <a href="<?php bloginfo( 'url' ) ?>/" title="<?php bloginfo( 'name' ) ?>" rel="home"><br /> <?php if($custom_logo == 'custom') { ?><br /> <img src="<?php bloginfo('template_directory'); ?>/images/uploads/<?php echo $custom_logo_image; ?>" border="0" alt="<?php bloginfo( 'name' ) ?>" /><br /> <?php } else if($custom_logo == 'default') { ?><br /> <img src="<?php bloginfo('template_directory'); ?>/images/logo.png" border="0" alt="<?php bloginfo( 'name' ) ?>" /><br /> <?php } else { ?><br /> <h1><?php bloginfo('name'); ?></h1><br /> <div class="description"><?php bloginfo('description'); ?></div><br /> <?php } ?><br /> </a><br /> </span><br /> </div><br /> </div><!-- #branding --></p> <p>I see that it's saying that if a custom logo has been specified, that it should grab the image from my template's .../images/uploads folder. When I manually replace the img src="..." portion with a specific url, then it is forced to display that particular image. Otherwise, it displays whatever image I had uploaded previously (through dynamic styling). So my first question is: <strong>where in the labyrinth of WP does it save the url of the previously uploaded header image?</strong></p> <p><strong>And how do I modify the code below so that it will override whatever else it's being told to do and grab the image I specify in the CSS?</strong> Because right now it won't listen to the parameters that I set in the CSS (making it !important also doesn't seem to work.)<br /> <code> `<br /> <?php if($custom_logo == 'custom') { ?><br /> <img src="<?php bloginfo('template_directory'); ?>/images/uploads/<?php echo $custom_logo_image; ?>" border="0" alt="<?php bloginfo( 'name' ) ?>" /><br />

    Also, as a corollary, I've implemented a style switcher that allows the visitor to toggle between several stylesheets. Each stylesheet features different background colors, fonts, etc but the one thing that I can't seem to change is the header image (because, like I said before, it seems to be hardcoded somewhere in the loop).

    So if anyone has any advice on how I can modify the above code (and any other possibly relevant codes) so that the header image can be stylesheet-specific and be controlled by the respective .css, I'd really appreciate it!

    Thanks!

  2. You did not specify a blog address or reason for posting when you created this topic.

    This support forum is for blogs hosted at WordPress.com. If your question is about a self-hosted WordPress blog then you'll find help at the WordPress.org forums.

    If you don't understand the difference between WordPress.com and WordPress.org, you may find this information helpful.

    If you forgot to include a link to your blog, you can reply and include it below. It'll help people to answer your question.

    This is an automated message.

  3. Ergh, sorry for the messed up styling of my post. I placed the code tags in the wrong place but it seems that I'm unable to edit the post....It would also help if there was a "preview post" option...

  4. Your site is not hosted on WordPress.COM and you are posting to the wrong support forum. This forum is for support of sites hosted on WordPress.COM.

    Your support questions must be posted to the correct support site for your softwareand that is here http://wordpress.ORG/support/

    For more on the differences: http://support.wordpress.com/com-vs-org/

  5. Oh, oops...apparently i have posted this in the wrong forum since it does not pertain to a wordpress.com hosted blog. Sorry! Can a moderator please delete this for me? I'll repost my question to the other more general support forum.Thanks.

  6. You're welcome and best wishes with your site.

Topic Closed

This topic has been closed to new replies.

About this Topic