Friends! If you want to display link directly to your extra field image then you must strip the default code that K2 uses to insert the image into it’s foreach loop.
You can do it by inserting this directly into your item.php override file.
<?php
$var = $this->item->extraFields->Image->value ;
$var = preg_replace(‘/<img src=”/’,””,$var);
$var = preg_replace(‘/” alt=”Image” \>/’,” “,$var);
echo ‘<a href=”‘ . $var . “TextOfLink” . “</a>” ;
?>
Rate for post
LT Digital Team (Content & Marketing)
Latest posts by LT Digital Team (Content & Marketing) (see all)
Only for Joomla! users Your website lost header area after update to Joomla! V5.2.4, how to solve it? Read more
Spring Sale! Grab 50% Off for everything on today, don't miss it. Coupon code: SPRING50 Redeem Now