WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Header Link in 2.8 (14 posts)

  1. zgarcia
    Member
    Posted 5 years ago #

    I upgraded to 2.8 and it wiped out all the code in my header including my Google analytics and advertising... But the bigger frustration is that I can't find a code fix to make the header link back to the home page... Users could click on the header image and get back to the front page http://www.ichromis.com/blog/

    Any help would be appreciated.

    ZG

  2. In your styles.css try adding the following:

    #header a {
    display:block;
    height: 192px;
    width: 740px;
    }
    You can put a border around it too while your testing to see where the link is and how big and then adjust the size.

  3. zgarcia
    Member
    Posted 5 years ago #

    All I want to do is make the entire kubrickheader.jpg a link to http://www.ichromis.com/blog/ It used to be done in the header.php so it would carry over to every page. Now in 2.8 where I would normally put it looks like this:

    <div id="header" role="banner">
    	<div id="headerimg">
    		<h1><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
    		<div class="description"><?php bloginfo('description'); ?></div>
    	</div>
  4. hungryheffy
    Member
    Posted 5 years ago #

    I have this exact same problem!
    Any luck finding a solution?

  5. zgarcia
    Member
    Posted 5 years ago #

    No luck... Anybody???

  6. Rhand
    Member
    Posted 5 years ago #

    Did you wrap it in a link yet? I mean wrapping it in <a href="link"></a> This works when you wrap it around an inline image and should work to make a divider clickable..

  7. esmi
    Forum Moderator
    Posted 5 years ago #

    That would result in nested links - which would in turn invalidate that code block. It could also create some rather unpredictable results cross-browser.

    crondeau's solution should work.

  8. Rhand
    Member
    Posted 5 years ago #

    Yes, it should. Zgarcia, did you try the suggested css?

  9. hungryheffy
    Member
    Posted 5 years ago #

    I tried adding the code to the css but it didn't seem to do anything but i did just copy and past it anywhere. If it requires more knowledge than that can someone please help? I really need some step by step instructions on how to make this work.
    Any help would be appreciated.

  10. hungryheffy
    Member
    Posted 5 years ago #

    I got mine to work. I've no idea if it's a good solution but it works.
    Change the first line from
    <div id="header" role="banner">

    to

    <div id="header" role="banner" onclick="location.href='<?php echo get_option('home'); ?>/';" style="cursor: pointer;">

    Hope this helps!

  11. zgarcia
    Member
    Posted 5 years ago #

    That worked perfectly!

    Thanks hungryheffy!

  12. Ellen Finkelstein
    Member
    Posted 4 years ago #

    hungryheffy,
    Can you rewrite that so I could put in an actual URL? I'd like my header image to point to the home page of my site, rather than my blog, but keep the blog title as a link to the blog's home page.
    Ellen

  13. Merchaholic
    Member
    Posted 4 years ago #

    Hey Ellen, couldn't you just change

    <div id="header" role="banner" onclick="location.href='<?php echo get_option('home'); ?>/';" style="cursor: pointer;">

    to

    <div id="header" role="banner" onclick="location.href='http://www.merchaholic.ca';">

    When I left that style of the cursor as pointer that's what was on my whole page so I got rid of it.

  14. Merchaholic
    Member
    Posted 4 years ago #

    Hmmzz, now I know why the pointer was on the whole page... My WHOLE page is clickable as a link back to my main site lmfao. How's that fixed? Must be somethin' easy.

Topic Closed

This topic has been closed to new replies.

About this Topic