• Resolved briancurran

    (@briancurran)


    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-300×100.gif” title=”Take our ‘2-Minute Security Audit’ and see how your current arrangements measure up…” />
    </div><!– end headerright –>

    Thanks
    Brian.

Viewing 6 replies - 1 through 6 (of 6 total)
  • <div id="headerright">
    <a href="https://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 -->
    Thread Starter briancurran

    (@briancurran)

    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….

    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="https://www.keyplus.co.uk/path-to-your-pdf-file/your-file.pdf">

    Thread Starter briancurran

    (@briancurran)

    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…

    Thread Starter briancurran

    (@briancurran)

    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?

    Thread Starter briancurran

    (@briancurran)

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

    <div id="headerright">
    <a href="https://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 -->
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Image in header isn’t clickable…’ is closed to new replies.