Support » Themes and Templates » Make banner in header clickable to page other than home page

  • I have read dozens of posts here about making the header clickable and I’ve read the header design in the codex. I’ve tried all the things that have been suggested, and I can’t seem to get my header to link to the page I want it to link to. I want it to link to a page other than the home page, like: When I put that in where it’s suggested you put a url to do onclick code, it still goes to the home page. Is there a trick to this?

    Here’s the header php code:

    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “”>
    <html xmlns=””>
    <head profile=”″>
    <meta http-equiv=”Content-Type” content=”<?php bloginfo(‘html_type’); ?>; charset=<?php bloginfo(‘charset’); ?>” />
    <meta name=”distribution” content=”global” />
    <meta name=”robots” content=”follow, all” />
    <meta name=”language” content=”en, sv” />

    <title><?php wp_title(”); ?><?php if(wp_title(”, false)) { echo ‘ :’; } ?> <?php bloginfo(‘name’); ?></title>
    <meta name=”generator” content=”WordPress <?php bloginfo(‘version’); ?>” />
    <!– leave this for stats please –>

    <link rel=”Shortcut Icon” href=”<?php echo get_settings(‘home’); ?>/wp-content/themes/elements-of-seo/images/favicon.ico” type=”image/x-icon” />
    <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=”alternate” type=”application/rss+xml” title=”<?php bloginfo(‘name’); ?> RSS Feed” href=”<?php bloginfo(‘rss2_url’); ?>” />
    <link rel=”pingback” href=”<?php bloginfo(‘pingback_url’); ?>” />
    <?php wp_get_archives(‘type=monthly&format=link’); ?>
    <?php wp_head(); ?>
    <style type=”text/css” media=”screen”>
    <!– @import url( <?php bloginfo(‘stylesheet_url’); ?> ); –>


    <div id=”wrap”>

    <div id=”stripe”></div>

    <div id=”nav”>

      <?php wp_list_pages(‘title_li=&depth=1’); ?>


    <div id=”masthead”>
    <h1>“><?php bloginfo(‘name’); ?></h1>
    <h3><?php bloginfo(‘description’); ?></h3>

    <div id=”banner” onclick=”location.href='<?php echo get_settings; ?>’;” style=”cursor: pointer;”></div>

Viewing 4 replies - 1 through 4 (of 4 total)
  • If you want a banner that links to another page just take the banner image and around the <img src="" /> tag put in a <a href="location-to-go-to"> </a>

    for example:

    <a href=""><img src="images/image.jpg"></a>

    Thats a lot easier than using a div.

    Thanks for you response. I’m not sure how to use this code or where to put it. I put it in the header php and it doesn’t do a thing. In the style.css, this is the code that’s in the header section for the header banner:

    #banner { background: url(“images/banner.jpg”) no-repeat; height:134px; }

    #banner1 { background: url(“images/banner1.jpg”) no-repeat; height:134px; }

    #banner2 { background: url(“images/banner2.jpg”) no-repeat; height:134px; }

    Ok I’m guessing you’re using 3 images to make 1 single image on a page then? (as in if you comment-out one of those lines part of the main image disappears?)

    Actually, no–I don’t know why the theme is set up this way. It has a different image for pages and for the main blog page and individual blog entries. I don’t need it to be that way (it’s different versions of a splat). If you take one of these lines out–the image part of the header disappears. But there’s no code that I can find in the css that looks like anything that makes that header clickable. That code seems to be in the div part of the header code I put above. But when I remove the bottom line of that header code, the header still clicks to the home page, and if I replace it with every bit of code that’s been suggested, it still clicks to the home page.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Make banner in header clickable to page other than home page’ is closed to new replies.