Hi,
I have a very simple Gallery where I need the individual images to link to pages on the site.
I have downloaded the WP Gallery Custom Links plugin and that now enables me to add the URLs to the images but they don’t work? For now I have added:
add_filter(‘avf_avia_builder_gallery_image_link’, ‘avia_change_gallery_thumbnail_link’, 10, 4);
function avia_change_gallery_thumbnail_link($link, $attachment, $atts, $meta)
{
$custom_url = get_post_meta($attachment->ID, ‘_gallery_link_url’, true);
if(!empty($custom_url))
{
$link[0] = $custom_url;
$link[‘custom_link_class’] = ‘aviaopeninbrowser’;
}
return $link;
}
to the bottom of Functions.php located in the Enfold theme folder.
I have followed a few threads about this but I haven’t seen anyone confirm that it works.
Any help would be appreciated.
Kind regards,
Brian