[resolved] Link header image to homepage - HELP! (16 posts)

  1. lomodeedee
    Posted 5 years ago #

    Does anyone know how to link header image to homepage?!
    I've used on my blog (http://www.body-pixel.com/) in 'Elegant Grunge editor' the option to simply upload header image with my banner... but i would really like to link my banner to the homepage, cuz it's a standard...

    I've tried by following these advices, but they aren't working in Elegant Grunge:

    I just don't get it what I'm doing wrong when replacing the code in Header.php editor... cuz the code in Elegant grunge does't look exactly the same as in examples in these tutorials...

    Thanks in advance!


  2. lomodeedee
    Posted 5 years ago #

    This is my Header.php code...

    [Code moderated as per the Forum Rules. Please use the pastebin]

  3. webjunk
    Posted 5 years ago #

    WHat about:

    <h1>"><?php bloginfo('name'); ?></h1>
    <a href="http://mysite.com"><h1>"><?php bloginfo('name'); ?></h1><a>

  4. lomodeedee
    Posted 5 years ago #

    hey, thx a lot... but unfortunately :( not workin'...

  5. webjunk
    Posted 5 years ago #

    Hopefully you did not copy exactly as I did have a small error:
    should be:
    <a href="http://mysite.com"><h1>"><?php bloginfo('name'); ?></h1></a>

    I use it all the time.

  6. lomodeedee
    Posted 5 years ago #

    :( nope... i mean... i added my web site instead of "http://mysite.com" ;) but still ain't workin'... i've checked it in chrome and safari, too... cause i thought that maybe Firefox and Super Cache Plugin decided to play with me...

  7. webjunk
    Posted 5 years ago #

    My first posting I had the end tag wrong.
    when it should have been:

  8. lomodeedee
    Posted 5 years ago #

    yeah, i know traveler... but this theme is slightly different because i can make customization through Editor in WP, and through kind of easier interface, where i can pick up 2 or 3 columns, and some cosmetic changes... through this interface i did upload my header... that's probably the reason of this mess...

    my hosting company (www.plus.hr) heard my silent screams on twitter, and contact me to try to solve the issue... i hope everything will be okay...

  9. webjunk
    Posted 5 years ago #

    Did you mean to post that someplace else? Makes no sense here.

  10. lomodeedee
    Posted 5 years ago #

    no, it's all in the same WP... bt it's not in the same directory... would be great to be able to upload a screen-shot here to show you...

  11. webjunk
    Posted 5 years ago #

    Can you copy/paste your header.php into Pastbin?

  12. FishDogFish
    Posted 5 years ago #

    You can do this

    <a href="yoursite.com">
    <div style="width:936px;height:150px;background:URL(http://www.yoursite.com/wp-content/uploads/2010/09/header.jpg)"></div>

    Be sure to make the div and the image the same size as the header, and make sure it's inside the header in the header.php

  13. lomodeedee
    Posted 5 years ago #

    @webjunk sorry for not answering tonight, but i fell a sleep cuz it was about 2am...
    @FishDogFish tnx a lot for your help, too...

    as a i got the message this morning from my hosting company Plus.hr, they solved my issue... trying to figure out how...
    i wanted to try this morning this one:

    Put this CSS into ‘style.css’:

    .promotion {
    position: absolute;
    width: 217px;
    height: 119px;
    top: 140px;
    left: 50%;
    margin-left: 20px;
    filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="/wp-content/themes/elegant-grunge/banner.png", sizingMethod="crop");
    text-indent: -9999px;
    z-index: 10;

    html>body .promotion { background: url('banner.png') no-repeat; }

    .promotion a { display: block; width: 100%; height: 100%; }

    Then, put this HTML at the bottom of header.php:

    <div class="promotion">

    Some text here, if needed


    I found it here in comments earlier but was lazy to try: http://atastypixel.com/blog/wordpress/themes/elegant-grunge/comment-page-8/#comments

    OK, thx once more guys, WP community and CMS rockZ!
    Hope somebody could use some stuff we've shared here...

  14. FishDogFish
    Posted 5 years ago #

    That seems like an awfully lot of mark up just to link to a header.

  15. webjunk
    Posted 5 years ago #

    Just looked at your site and it does not work in my browser if you made the changes. So its not fixed, at least in all browsers. And I agree with Fishdogfish its too much.
    Now I thought DXImageTransform.Microsoft.AlphaImageLoader was depreciated or taken out in newer versions of IE. It was just for the lack of proper png support back in IE 5 or 6.
    But just now taking a quick look at your code I see the issue. The link you have right now like I said to use but is around the TEXT "Body Pixel" inside the header div. The problem is in your CSS you are putting the banner (from the header in CSS) over the top of the text. It comes from here:

    #header div {
    	background: url(http://www.body-pixel.com/wp-content/uploads/2010/09/pcb_banner.color_ver._retro.gif) no-repeat center top;

    So not only is the text hidden so is the Link. You need the BANNER to have the link. You could change the depth/layers using z-index but then the text would display on top of the banner. WHat I think you need to do is take the image out of the css and put it in place of the text. You could just hardcode the image (how often do we change banners?) but if the theme supports uploading a banner you can just add code for it. Here is what I use in a couple of the themes I have written. Just need to make sure "$logo" is set to whatever variable your theme uses for the uploaded banner:
    ` if($logo): ?>
    <h1 class="logo"><a href="<?php bloginfo('url'); ?>/"><img src="<?php echo $logo; ?>" title="<?php bloginfo('name'); ?>" alt="<?php bloginfo('name'); ?>" /></a></h1>
    <?php else: ?>
    <h1 class="logo"><a href="<?php bloginfo('url'); ?>/"><?php bloginfo('name'); ?></a></h1>
    <?php endif; ?>`

  16. lomodeedee
    Posted 5 years ago #

    hey guyz... so sorry, but i didn't get 'notify followup' in my mail box... found it via analytics... i've managed to resolve the issue with IE... and it's the way webjunk suggested, although this theme gave a lot of headache to people using IE... i'm slightly ignoring this browser... the thing is finally working... TNX a lot!

Topic Closed

This topic has been closed to new replies.

About this Topic