Home › Forums › General Issues › Image clickable › Reply To: Image clickable
I don’t know anything about the popup in that theme, I’m assuming that you are supposed to link to a larger size image, so you’ll need to get both sizes. Your code should probably look something like this.
$image = get_field('image');
$small_size = 'cb-480-240'; // (thumbnail, medium, large, full or custom size)
$large_size = 'full';
if ($image) {
$small_image = wp_get_attachment_image($image, $small_size);
$large_image = wp_get_attachment_image_src($image, $large_size);
?>
<a class=”cb-lightbox" href="<?php echo $large_image[0]; ?>
<?php echo $small_image; ?>
</a>
<?php
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.