Support » Themes and Templates » Linking Header to Homepage

  • Resolved hmnikatz

    (@hmnikatz)


    Hi, I am trying to make it so when people click on my header image, they go back to the main page….so if they leave a comment, instead of having to re type in the page address, they can click on the header and go back to the main page… I am a complete beginner, but I am getting a long ok….I know minimal HTML code, so if you are going to help, be as descriptive as possible. Here is what I think is my header code…

    <style type=”text/css” media=”screen”>
    #headerimg { margin: 0; margin-top: 0px; height: 200px; width: 800px; }

    #headerimg { background: url(‘<?php bloginfo(‘stylesheet_directory’); ?>/images/header.jpg’) no-repeat top;}
    #footer { background: url(‘<?php bloginfo(‘stylesheet_directory’); ?>/images/footer.jpg’) no-repeat top;}

    </style>

    I want that if people click on header.jpg, they are brought back to http://www.sternshowclips.com

    Could someone show me what the new code would look like…

    Thanks! 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • I keep trying to do it and the header image is dissapearing, I cant figure out where to put the a href code. Im not even sure if thats the right code to use.

    If i do it like this..

    A href = “www.sternshowclips.com”><style type=”text/css” media=”screen”>
    #headerimg { margin: 0; margin-top: 0px; height: 200px; width: 800px; }

    #headerimg { background: url(‘<?php bloginfo(‘stylesheet_directory’); ?>/images/header.jpg’) no-repeat top;}
    #footer { background: url(‘<?php bloginfo(‘stylesheet_directory’); ?>/images/footer.jpg’) no-repeat top;}
    </a
    </style>

    Then the whole page is linked to the main page…i just want the header pic…someone has to know…please help.

    bump

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    You’re changing the wrong thing. That’s just a style, you cannot link a style.

    Look lower on your page, where the header is actually displayed. It’ll be something like this:

    <div id="header">
    	<div id="headerimg">
    		<h1><a href="http://www.sternshowclips.com/"></a></h1>
    		<div class="description"></div>
    	</div>
    </div>

    Notice how you have nothing in that Anchor tag? That’s why you have no main link, since anchors are inline and such.

    One trick way to do this is to make the anchor force to block mode and expand it to 100% of the available space. You’d need to add this code to your style that you’ve been futzing with:

    div#headerimg a {
    width:100%;
    height:100%;
    display:block;
    }

    This should work. I think. You may need to add an &nbsp; into the anchor. Not sure.

    Otto, Sir, you are a genious, thanks for all of your help.

    I am sure you will see more help threads from me and I thank you in advance for anymore help u give me.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Linking Header to Homepage’ is closed to new replies.