I would like to add a static image to my single-package.php template on my travel website.
I have included the image like this:
<?php
$image = "http://dev5.4loopdigital.co.za/wp-content/uploads/2015/06/servicesaccomm.jpg";
$width = 960;
$height = 300;
echo '<img src="'.$image.'" style=width:"' . $width . 'px;height:' . $height . 'px;">';
?>
What must I add to make that image a clickable image that opens up that same image in a new tab/window in full size?
Thanks so much!
Currently you just have the image - what you want to do is also make the image wrapped in a link, so that when you click the image it takes you to that link's page. This can be done using the
a
HTML tag and thehref
attribute.The following code works for me: