On my project, I have this code and I need to add a link on a image popup using Fancybox
<?php if ($this->dados_globais['popup'] && $this->router->fetch_class() == "home") {
foreach ($this->dados_globais['popup'] as $popup) {
if ($popup->imagem) {
$img = base_url('./admin/assets/upload/popups/' . $popup->imagem);
echo '<a class="popup" data-fancybox="popups" href="' . $img . '" title="' . $popup->nome . '" data-caption="' . $popup->nome . '"></a>';
} else {
$link = $popup->link;
echo '<a class="popup" data-fancybox="popups" href="' . $link . '"></a>';
}
}
} ?>
Please advise so I can insert a link on an image.
2
Answers
i did this and it worked
You just have to figure out how to create link to thumbnail image and then place inside
<a>
element, smth like this: