WordPress.org

Forums

Please help- Header Link- have tried everything (29 posts)

  1. hopeworks
    Member
    Posted 7 years ago #

    I have searched and searched in finding an answer.

    I have a custom header in my blog (kubrick theme) I need the header to be a link to my home page (not my blog) my website homepage here

    here is my current header.php

    <div id="header">
    <div id="headerimg">
    <h1>/"><?php bloginfo('name'); ?></h1>
    <div class="description"><?php bloginfo('description'); ?></div>
    </div>

    my blog address is http://www.hopeworks.us/blog

  2. drmike
    Member
    Posted 7 years ago #

    Do us a favor and repost teh code that you used here but place it within backticks. That's the key above the tab key and to the left of the '1' key on a standard pc keyboard.

    That way we can see your code.

    thanks,
    -drmike

  3. hopeworks
    Member
    Posted 7 years ago #

    <div id="header">
    	<div id="headerimg">
    		<h1><a href="<?php echo get_settings('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
    		<div class="description"><?php bloginfo('description'); ?></div>
    	</div>
  4. Marcel Brinkkemper
    Member
    Posted 7 years ago #

    change <a href="<?php echo get_settings('home'); ?>/"><?php bloginfo('name'); ?></a> for <a href="http://www.hopeworks.us/">Your link title</a>

  5. hopeworks
    Member
    Posted 7 years ago #

    it now looks like this

    <div id="header">
    	<div id="headerimg">
    		<h1><a href="http://www.hopeworks.us/">Your link title</a></h1>
    		<div class="description"><?php bloginfo('description'); ?></div>
    	</div>

    will it happen immediately? it didnt. i deleted cache

  6. hopeworks
    Member
    Posted 7 years ago #

    i might be retarded. should "your link title" be the name of hopeworks.us in blogroll?

  7. Marcel Brinkkemper
    Member
    Posted 7 years ago #

    yes

  8. hopeworks
    Member
    Posted 7 years ago #

    should it happen immediatetly?

    <div id="header">
    	<div id="headerimg">
    		<h1><a href="http://www.hopeworks.us/">Home Page</a></h1>
    		<div class="description"><?php bloginfo('description'); ?></div>
    	</div>
  9. hopeworks
    Member
    Posted 7 years ago #

    hello?

  10. Marcel Brinkkemper
    Member
    Posted 7 years ago #

    what should happen immediately?

  11. hopeworks
    Member
    Posted 7 years ago #

    the link to my homepage (www.hopeworks.us) is not working through the custom header on my blog (www.hopeworks.us/blog) I followed the steps above and it did not work.

  12. hopeworks
    Member
    Posted 7 years ago #

    In my links section in dashboard I have two categories: blogroll and links. My links are all under the category "links". http://www.hopeworks.us is named "Home Page". I followed the steps you said to do and it does not work

  13. Marcel Brinkkemper
    Member
    Posted 7 years ago #

    aha now I see whee you come from, you have set the headerimage element to display:none and the image is
    actually the background of the header element.
    the <h1> is not visible or clickable.
    try this for your header:

    <div id=header onclick="location.href='http://www.hopeworks.us/'">

  14. hopeworks
    Member
    Posted 7 years ago #

    i tried it and it worked but it screwed with the look of the theme.

  15. hopeworks
    Member
    Posted 7 years ago #

    alright i got it to work. the header clicks everything looks good. thank you.

    one more thing though, the mouse cursor does not give the "hand" so it doesn't look like it will click. can i do anything?

  16. Sivar
    Member
    Posted 7 years ago #

    Apply cursor: pointer; to #header.

  17. hopeworks
    Member
    Posted 7 years ago #

    is that the exact code?

  18. hopeworks
    Member
    Posted 7 years ago #

    '<div id="header">
    <div id=header "cursor: pointer;" onclick="location.href='http://www.hopeworks.us/'">
    </div>'

    this is what i got. no cursor though

  19. Sivar
    Member
    Posted 7 years ago #

    I should have known... *g*

    No, it belongs in your style.css ... You'll find:

    #header {
    	background-color: #73a0c5;
    	}

    Modify that to:

    #header {
    	background-color: #73a0c5;
    	cursor: pointer;
    	}
  20. hopeworks
    Member
    Posted 7 years ago #

    didnt work. this is my css

    #header {
    	background-color: #73a0c5;
            cursor: pointer;
    	}

    and this is my header.php

    <div id="header">
    	<div id=header onclick="location.href='http://www.hopeworks.us/'">
    	</div>

    any other suggestions. thaks

  21. Sivar
    Member
    Posted 7 years ago #

    *sigh* Why two header-divs? Just...

    <div id="header" onclick="location.href='http://www.hopeworks.us/'">
    </div>
  22. hopeworks
    Member
    Posted 7 years ago #

    huh? the header.php works fine. the header clicks and links to homepage (hopeworks.us) I now just need the cursor to recognize the link, that is why I tried your cursor code in the css as you said. But it did not work.

  23. Sivar
    Member
    Posted 7 years ago #

    Would you please just try to replace these two div with the one I posted? Do it for me :)

  24. Chenzo
    Member
    Posted 7 years ago #

    I have the same problem, my header.php is:

    <div id="page">
    <div id="headerimg" onclick="location.href='http://www.soydeoeste.com.ar'">
    </div>

    And style.css

    #header {
    	background-color: #000000;
    	cursor: pointer;
    	}

    The cursor don't recognize it as a link, thanks.

  25. Chenzo
    Member
    Posted 7 years ago #

    I have the same problem, my header.php is:

    <div id="page">
    <div id="headerimg" onclick="location.href='http://www.soydeoeste.com.ar'">
    </div>

    And style.css

    #header {
    	background-color: #000000;
    	cursor: pointer;
    	}

    The cursor don't recognize it as a link, thanks.

    -----

    My title image is the personalheader.jpg, when i quit de <div id="headerimg" and put it as <div id="header" the background recognize the cursor, but there's no more image :P

    Check it at http://www.soydeoeste.com.ar/

  26. iscifi
    Member
    Posted 7 years ago #

    I wouldnt use the onclick, it will break RSS for your blog, or it can.

    Something like this works :) at least for me
    <div id="header">
    <div class="top">
    <img src="logo.gif" alt="image" border="0" />
    </div>
    </div>

    if you make logo.gif an blank gif 1 pixel X 1 pixel, you can then change the width and height to overlay another logo or graphic and make it clickable, just add the width/height to the img tag.

    of course my css tells the browser where header and top appear on the blog so you need to also edit your css..

    good luck

  27. marsosudiro
    Member
    Posted 7 years ago #

    Thank you, Sivar, and iscifi. I've gone with Sivar's solution for now (because it's simple enough for me to implement -- and it worked!) but may try iscifi's when I pick up some more coding skill.

  28. JeromeDelacroix
    Member
    Posted 7 years ago #

    Got exactly the same problem.

    Found your inputs useful.

    Modified the css to add the pointer.

    Finally changed the header.php. Had to get rid of the blog description and replace it by a space.

    Code looks like this:

    <div id="page">

    <div id="header" onclick="location.href='http://www.cooperatique.com/'">
    <div id="headerimg">

    <div class="description"> </div>
    </div>
    </div>
    <hr />

    I know my div look strange and don't ask me why there is <hr /> in the end.

    But at least it works enough for me, till I install the new WP version.

  29. Mearle
    Member
    Posted 7 years ago #

    It took some filtering out of the chitchat back and forth, but I got my header link change to work on the first try. Awesome!
    That's at http://www.whiteveilstudios.com/wordpress

    Thank you!!!

Topic Closed

This topic has been closed to new replies.

About this Topic