Image Grid widget, how to link individual images in grid
I’m using the Image Grid widget in a page builder layout in a Harmonic child theme.
I need the images in the grid to each link to separate urls, so when adding images to the grid, I also insert the destination I want each image to link to by adding the appropriate link to the URL field.
However, when I open the page, I see the images, but none them link. Inspecting an image with Firebug reveals that there is no link in the code.
Is this an issue with the Image Grid widget?
I can’t share an example as I’m working on localhost
Thanks in advance
This is our free support forum. Replies can take several days.
Need fast email support? Get SiteOrigin Premium
Replies
2in
change
<?php foreach( $instance['images'] as $image ) { echo '<div class="sow-image-grid-image">'; echo wp_get_attachment_image( $image['image'], $image['display']['image_size'], false, array( 'title' => $image['title'] ) ); echo '</div>'; } ?>to
<?php foreach( $instance['images'] as $image ) { echo '<div class="sow-image-grid-image">'; echo (!empty($image['url'])) ? "<a href='{$image['url']}'>" : ''; echo wp_get_attachment_image( $image['image'], $image['display']['image_size'], false, array( 'title' => $image['title'] ) ); echo (!empty($image['url'])) ? "</a>" : ''; echo '</div>'; } ?>this won’t stick on any plugin update.
hopefully an mod see’s this and submit it to code.
Replies on this thread are closed.
Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.