So let me start by explaining what the code you posted above does. The entire block of code generates one link: there is a group of if statements that are defined based on some settings. For example, if you have determined that people must register in order to read more, the link will say "Register to learn more ..."
The part that we are interested in here, however, since we want to turn images into links, is the URL to which we want to link the images. This is true on the first line:
<a href="<?php echo $this->item->readmore_link; ?>"
therefore, we know that the URL is provided dynamically thanks to $item->item->readmore_link
, and all this code echoes in HTML.
It remains only to edit your Joomla template on the page on which you have images (probably the same file from which you took this code). It seems like this should be part of a larger PHP loop that iterates over all posts. Somewhere above where you found this code, there should be code for the inline image that matches this message.
I'm not sure how it will look, it could be <img src="<? stuff here; ?> />
, Or it could be dynamically generated. Keep reading. If you still don't know where to find it at the end, edit your post with the full template code in which you received the above shutdown. No matter what it looks like, in the next step it is called <WHATEVER IMAGE CODE YOU FOUND ABOVE>
:
You should wrap this image with a tags so that it looks like this:
<a href="<?php echo $this->item->readmore_link; ?>"> <WHATEVER IMAGE CODE YOU FOUND ABOVE> </a>
That should do it. Let me know if you have any problems, I will be more than happy to make my post more specific if you can provide more detailed information, but I tried to explain it well enough so that you can understand it with the help of the couple trying.
source share