WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How do I Make the header image a link to my main page? (4 posts)

  1. erwan.bancal
    Member
    Posted 5 years ago #

    Is there a way to make the image in the header file a link? My problem is that on that blog there are no titles, http://www.strada-dici.com/EnConstruction/ (the title is in the image). so I would like to transform the image into a link to my index page.

    The code looks like that
    #header{width:980px;height:250px;text-align:center;background:url(images/head.gif) no-repeat top;}

    The code in header.php is

    <!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>
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <title><?php
      if(is_single())
      {
       the_title();
       echo " | ";
       bloginfo("name");
      }
      else
      {
       bloginfo("name");
       wp_title();
      }?></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />
    <link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/favicon.ico" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
    <?php wp_head(); ?>
    </head>
    <body>
    <div id="wrapper">
    	<div id="head
    
    er">
    			<h1><a>/"><?php bloginfo('name'); ?></a></h1>
    <?php
    
    ?>
    
    			<div class="description"><?php bloginfo('description'); ?></div>
    	</div>
    	<div id="main">

    Greatfully,
    --
    Erwan

  2. tn33
    Member
    Posted 5 years ago #

    I think you can add a onclick tag into the css code but isn't something I have done myself.

    I'll take another look and post back....

    Best

    Tony

  3. educationthemes
    Member
    Posted 5 years ago #

    Change the header div at the top to read like this:

    <div id="header" onclick="location.href='http://www.strada-dici.com/EnConstruction/';" style="cursor: pointer;"></div>

    That should make the entire area clickable and take you back home.

  4. erwan.bancal
    Member
    Posted 5 years ago #

    Bravo,
    It works many thanks

    --
    Erwan

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.