制作图像有链接

I`m new to this website and I was hoping to get my first question out and get some feedback on my issue.

I am creating a "slider" which you can find here: http://complusoft.net/demo-catarroja2/es/ (at the very beginning of the page) and i`m trying to make the images which pass through the slide to be a link.

Here you can find the code which I have done:

<?php foreach ($items as $key=>$item):  ?>
        <?php if($params->get('itemImage') && isset($item->image)): ?>
            <a class="moduleItemTitle" href="<?php echo $item->link; ?>">
            <img src="<?php echo $path1;?>?src=<?php echo $item->image;?>&w=635&h=386&zc=1&q=100" alt="<?php echo K2HelperUtilities::cleanHtml($item->title); ?>" title="#htmlcaption<?php echo $key;?>"/>
            </a>
        <?php endif; ?>
    <?php endforeach; ?>
    </div>
    <?php foreach ($items as $key=>$item):  ?>
    <div id="htmlcaption<?php echo $key;?>" class="nivo-html-caption">
    <?php if($params->get('itemTitle')): ?>
        <!--<h2><a class="moduleItemTitle" href="<?php echo $item->link; ?>"><?php echo $item->title; ?></a></h2>-->
    <?php endif; ?>
    <div class="clr"></div>
        <?php if($params->get('itemIntroText')): ?>
        <div class="description-slider2">
            <p><?php echo $item->introtext; ?></p>
        </div>
    <?php endif; ?> 
    </div>
<?php endforeach; ?> 

Ive looked around the internet and besides my own knowledge I know this should be the correct way besides the point that this is simple HTML I believe, I may be wrong please correct me if so.