Creating a link via shortcode function

Hi,

I have a plugin which doesn’t do what I need it to so I have to edit the code. It’s an image based plugin which I need to add links in the thumbnail descriptions. I have managed to edit the plugin to display whatever descriptions. However, I need to create a clickable link which isn’t yet possible.

<p align="left" style="margin-left:0px;">
<?php echo $image->alttext ?>

<?php echo $image->ngg_custom_fields["img_url"] ?>
</p>

I added the ngg_custom_fields[“img_url”] bit which displayed the URL that I have added but can I change the code somehow to make it clickable?

You go back to basic HTML and create a test link in longhand on the page.

eg


<p align="left" style="margin-left:0px;"> 
<a href="/myimages/test.jpg" alt="My test image">test.jpg</a>
</p>

(change the values so that the link works, linking to a test image which does exist)

You get that working so the path is clearly correct and clicking the link takes you to the image (in this case).

You then replace the variables with PHP code which generates the correctly formed HTML

eg


<p align="left" style="margin-left:0px;"> 
<a href="/myimages/<?php echo $image->ngg_custom_fields["img_url"] ?>" 
   alt="<?php echo $image->alttext ?>">
    <?php echo $image->ngg_custom_fields["img_url"] ?>
</a>
</p>

I added some line ends in order that it displays correctly on this forum, that’s all.