Support » Fixing WordPress » Getting my header image to link

  • hey_suburbia

    (@hey_suburbia)


    How can I make bg.jpg link to my index.html?

    I have my image in a style sheet:
    body {
    background: #4F402A url(img/bg.jpg) no-repeat top left;
    font-family: Verdana, Helvetica, sans-serif;
    font-size: 10px;
    line-height: 14px;
    color: #333;
    margin: 0;
    padding: 0;
    text-align: center; /* IE 5.5 hack */
    }

    —————————————

    This is my header.php code:

    <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”>

    <div id=”masthead”>
    <div id=”pagetab”>
    <div class=”ltab”> </div>
    <?php wp_list_pages(‘title_li= ‘); ?>
    <div class=”rtab”> </div>
    </div><!– end PAGETAB –>
    <h1>“><?php bloginfo(‘name’); ?></h1>
    <span class=”description”><?php bloginfo(‘description’); ?></span>

Viewing 3 replies - 1 through 3 (of 3 total)
  • aymie

    (@aymie)

    I actually do this:

    < a href="index.html" title="Index"><img src="mytitleimage.jpg" border="0" alt="Index">
    </a >

    It links your image to the file you want. You can change the link text to anything you want.

    If you have trouble linking the image, you may want to make it a non-body background and put it as a background image in a seperate div. Something like this:

    .titleimage {
    background: #4F402A url(img/bg.jpg) no-repeat top left;
    font-family: Verdana, Helvetica, sans-serif;
    font-size: 10px;
    line-height: 14px;
    color: #333;
    margin: 0;
    padding: 0;
    text-align: center; /* IE 5.5 hack */
    }

    Then do this:

    < a href="index.html" title="Index"><div class="titleimage"></div>
    </a >

    Hope that helps. (NOTE: I put a space between the < a and a > to get it to read as a code and not and not html coding.

    Thanks for the help, but since my header is a background image it doesn’t work (or maybe I’m doing something wrong..)

    I just went to the link in your profile and it appears that your header does link to your home page. Are we not talking about http://www.basicfunction.com/?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Getting my header image to link’ is closed to new replies.