WordPress.org

Forums

[resolved] Image in header isn't clickable... (7 posts)

  1. BrianCurran
    Member
    Posted 6 years ago #

    Hi,
    I've added an image to the header, which I would like to turn into a link that opens a PDF file in a new window. Please see here...

    I'm not familiar with php so I've put the code below, what else do I add to this to make the image 'clicky'?

    <div id="headerright">
    <input type="image" src="<?php bloginfo('template_directory'); ?>/images/2minutes-300x100.gif" title="Take our '2-Minute Security Audit' and see how your current arrangements measure up..." />
    </div><!-- end headerright -->

    Thanks
    Brian.

  2. buddha trance
    Member
    Posted 6 years ago #

    <div id="headerright">
    <a href="http://www.keyplus.co.uk/path-to-your-pdf-file/your-file.pdf"><input type="image" src="<?php bloginfo('template_directory'); ?>/images/2minutes-300x100.gif" title="Take our '2-Minute Security Audit' and see how your current arrangements measure up..." /></a>
    </div><!-- end headerright -->
  3. BrianCurran
    Member
    Posted 6 years ago #

    That almost worked ;)
    It pushed the image off to the right and gave it a crappy border so I've had to put it back to the way it was....

  4. buddha trance
    Member
    Posted 6 years ago #

    That's weird... it was simply adding an html link...
    The border was created because the image became a link, you are probably in IE?

    To take the border out you can try <a style="border:none" href="http://www.keyplus.co.uk/path-to-your-pdf-file/your-file.pdf">

  5. BrianCurran
    Member
    Posted 6 years ago #

    The border is showing in Chrome, IE and Firefox (probably down to the lack of editing skills when creating the image)

    The original RSS image is in the background so that must be throwing the image out to the right and down. Just need to find that somehow...

  6. BrianCurran
    Member
    Posted 6 years ago #

    Ok, the border is gone and the image lines up fine now. Added target="_blank" to the end of the link but I'm not sure if that's the correct way to enter it.

    Chrome works perfectly
    Firefox opens 2 PDF's
    IE doesn't open anything

    Any more suggestions?

  7. BrianCurran
    Member
    Posted 6 years ago #

    Fixed the problem, the code shown below works fine now: -

    <div id="headerright">
    <a href="http://www.keyplus.co.uk/wp-content/uploads/2009/01/2-minute-audit.pdf"> <img src="<?php bloginfo('template_directory'); ?>/images/2minutes-300x100.gif" title="Take our '2-Minute Security Audit' and see how your current arrangements measure up..." />  </a>
    </div><!-- end headerright -->

Topic Closed

This topic has been closed to new replies.

About this Topic