Link to home
Start Free TrialLog in
Avatar of kmurphychi
kmurphychi

asked on

Make PHP image a link

Hi.  I have a Joomla site and have added the following code to the main index.php file to add the social networking buttons to it, however not being familiar with PHP, I don't know how to make those images clickable and add the URLs.  Also need to make sure the URL target is blank so that people don't leave the website and a new web page is opened.  Any help would be great.
Thanks!
<div class="social"><p>Follow Us</p><img src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template;?>/images/twitter.png" border="0" alt="<?php echo JText::_('Twitter'); ?>" width="15" height="19" /><img src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template;?>/images/facebook.png" border="0" alt="<?php echo JText::_('Facebook'); ?>" width="22" height="22" /></div>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of PranjalShah
PranjalShah
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kmurphychi
kmurphychi

ASKER

Thank you!
why dont you use one of the many social plugins - All the hard ork is done for you
Hi,
Just try to put it in a link like this:

 
<div class="social">
	<p>Follow Us</p>
	<a href="http://twitter.com/"><img src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template;?>/images/twitter.png" border="0" alt="<?php echo JText::_('Twitter'); ?>" width="15" height="19" /></a> 
	<a href="http://www.facebook.com/"><img src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template;?>/images/facebook.png" border="0" alt="<?php echo JText::_('Facebook'); ?>" width="22" height="22" /></a>
</div>

Open in new window


Just follow the tutorial on how to create a link:
See: HTML Hyperlinks (Links)

Cristi
sorry submitted after you accepted the above - ah well :)