WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Header Image Link and Sidebar Issues (19 posts)

  1. mkgago
    Member
    Posted 9 years ago #

    Two things I'd like to do (using default Kubrick template in WP 1.5):

    1. Make my custom header image a link to the home page

    Right now, in header.php I have this line:
    #headerimg { background: url('<?php bloginfo('stylesheet_directory'); ?>/images/personalheader.gif') no-repeat top;}

    How do I make that image into a link? (I don't know if this is what is screwing me up, but I set the display: none for these lines later in header.php:

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

    2. How can I make the sidebar appear not just on the home page, but on permalink, category, and archive pages?

    Thanks very much in advance for the help.

  2. Lorelle
    Member
    Posted 9 years ago #

    <div id="header">
    <div id="headerimg">
    <a href="http://yoursite.com/" title="link to my site"><h1 class="invisible">"><?php bloginfo('name'); ?></h1>
    <div class="invisible"><?php bloginfo('description'); ?></div>
    </a></div>

    Just add a link in there.

  3. water111
    Member
    Posted 9 years ago #

    See Kubrick's FAQ's here.

    Q: How do I make the entire header clickable? Currently, only the header text functions as a link...
    A: Open index.php. Change line 59, from <div id="header"> to <div id="header" onclick="location.href='http://siteaddress/';" style="cursor: pointer;"></div>. This will make the entire header a link.

  4. elitist
    Member
    Posted 9 years ago #

    I opened up my index.php to make these changes and I swear <div id="header"> is not a part of the code. If it is in there please tell me WHERE (I looked 10 times and couldn't find it). If it isn't any ideas why not and is there still a way to make my header a link? Thanks and here's what my index.php looks like:

    <?php get_header(); ?>

    <div id="content" class="narrowcolumn">

    <?php if (have_posts()) : ?>

    <?php while (have_posts()) : the_post(); ?>

    <div class="post">
    <h2 id="post-<?php the_ID(); ?>">" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></h2>
    <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>

    <div class="entry">
    <?php the_content('Read the rest of this entry »'); ?>
    </div>

    <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit','','|'); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>

    <!--
    <?php trackback_rdf(); ?>
    -->
    </div>

    <?php endwhile; ?>

    <div class="navigation">
    <div class="alignleft"><?php posts_nav_link('','','« Previous Entries') ?></div>
    <div class="alignright"><?php posts_nav_link('','Next Entries »','') ?></div>
    </div>

    <?php else : ?>

    <h2 class="center">Not Found</h2>
    <p class="center"><?php _e("Sorry, but you are looking for something that isn't here."); ?>
    <?php include (TEMPLATEPATH . "/searchform.php"); ?>

    <?php endif; ?>

    </div>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

  5. elitist
    Member
    Posted 9 years ago #

    For anybody else out there having the same trouble I had - I was able to accomplish the same thing by opening up header.php and adding the code from Kubrick's FAQ minus the </div> at the end. I am not a programmer so if this is wrong I hope somebody will correct me or you will at least not hold me responsible - I just know it worked for me.

  6. DaveReed
    Member
    Posted 9 years ago #

    Elitist, I think you did it correctly. I was having the same problems. I think the difference is in the WordPress specific version of Kubrick.

  7. Kerim
    Member
    Posted 9 years ago #

    In the WordPress version of Kubrick, the header is not part of index.php, but resides in its own file: header.php. You will see <div id="header"> at the bottom of the page. Make sure not to accidentally add a second </div> since you already have one at the bottom of the page - and the instructions make it sound like you should add another one. You should not.

  8. sodafizz
    Member
    Posted 9 years ago #

    I too am trying to make my custom header image a link to the home page. I’m using Alex King’s “Wallpaper� style sheet with the WP 1.5 theme. http://www.featuringdave.com/wordpress/

    I’ve tried the suggestions in all the above posts, but am stuck. My header.php file reads:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">

    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

    <title><?php bloginfo('name'); ?><?php wp_title(); ?></title>

    <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats please -->

    <style type="text/css" media="screen">
    @import url( <?php bloginfo('stylesheet_url'); ?> );
    </style>

    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
    <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />

    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <?php wp_get_archives('type=monthly&format=link'); ?>
    <?php //comments_popup_script(); // off by default ?>
    <?php wp_head(); ?>
    </head>

    <body>
    <div id="rap">
    <h1 id="header"></h1>
    <div id="content">

    <!-- end header -->

  9. xmiinc
    Member
    Posted 9 years ago #

    This is all great, and helped me hot-link personalheader.jpg...except for one thing: it doesn't just link the graphic, its the whole header *section*, background and all that's linked. This creates a new problem for me, unless I can determine the boundaries of the linked area and make it smaller than the total width/height of the header area. Is the only way to link just the graphic, to simply re-do the image-insertion and associated css from scratch? I can prolly do it, after reading up on horizontal-positioning with div instead of my old standby: tables...(I know, Lorelle: NO TABLES! ;))

    But I thought I'd ask, in case there's another way to tweak the existing template code before I launch into ripping out whole sections.

    cheers!

  10. xmiinc
    Member
    Posted 9 years ago #

    Any suggestions on how to make a part of, rather than the whole, header a hot-link? Preferably the jpeg itself rather than the whole div, as is the case with my site at the moment. The Reason: I can't place other clickable items into the header if the whole header is hot. If the solution is to re-code without using divs, then so be it. Just hoping someone with more knowledge about this can confirm or deny...

    cheers!

  11. hole64
    Member
    Posted 9 years ago #

    "Open [header.php]. Change [line 55], from <div id="header"> to <div id="header" onclick="location.href='http://siteaddress/';" style="cursor: pointer;"></div>"

    I also followed these directions from the Bonsai site too, but the problem with my page is that it makes the entire header a link, but it pushes my entries out of the table and jacks up the layout. Any ideas about what this is happening?

  12. sf1818
    Member
    Posted 8 years ago #

    Do not edit the "header" line - you must edit the "headerimg" line to prevent errors :

    <div id="headerimg"onclick="location.href='http://yoursite/';" title="Return to Homepage"; style="cursor: pointer;">

  13. nl4045
    Member
    Posted 8 years ago #

    FINALLY!!!
    Someone who explained it in a way that worked for me, excellent!

  14. glytch
    Member
    Posted 8 years ago #

    that worked for me too, thanks sf1818. I just added that bit and my whole header links. great

  15. miaow
    Member
    Posted 8 years ago #

    Thank you elitist - you provided the one explanation that I found that both made sense to me and worked!
    :)
    B

  16. dreamgirl
    Member
    Posted 7 years ago #

    okay i wanted to link my but my index.php (which is the newest downloaded version ) and i dont have a line 59 or <div id="header"> there.

    so i went to header.php and i changed headering tag to this <div id="headerimg"onclick="location.href='http://www.72namesofmadonna.com/thelight/'; style="cursor: pointer;">

    and now some pages are out of whack ( http://72namesofmadonna.com/thelight/2006/09/30/rosh-hashanah-set-the-mold-for-our-year-but-were-still-pouring-the-plaster/ ) some dont even display my kubrickheader.jpg ( http://72namesofmadonna.com/thelight/2006/09/28/ive-been-exhausted-all-week-you/ ) and some are fine ( http://72namesofmadonna.com/thelight/2006/09/29/yesterday-i-talked-about-taking-it-slow/ ) i didnt add an extra div and changed nothing else

    help!

    thank you in advance

  17. dreamgirl
    Member
    Posted 7 years ago #

    forget all that i just wrote a post and now all my formatting is gone. but not in my pages.

  18. rudolfnu
    Member
    Posted 7 years ago #

    It should be:
    <div id="headerimg"onclick="location.href='http://your site/'" title="Return to Homepage!" style="cursor: pointer;">

    Otherwise your site will not be Valid XHTML 1.0 Transitional site,

    take away ; between it, then it´s ok!

  19. Moonaker007
    Member
    Posted 7 years ago #

    How would I do it if the code is:

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

Topic Closed

This topic has been closed to new replies.

About this Topic