Support » Plugins » Hacks » Gallery Shortcode linking somewhere else

  • i wanted the thumnails of my [gallery] linking to some specific web page… it’s a sponsors page, with their logos linking to their pages, not to the image nor the attachment page…

    i used Alternate Text to put the desired link

    and then modified wp-includes/media.php line 846:

    `$linkImg = wp_get_attachment_image($id, $size, true, false);
    $linkAlt = get_post_meta($id, ‘_wp_attachment_image_alt’, true);
    $linkMod = ‘<a href=”‘.$linkAlt.'”>’.$linkImg.'</a>’;

    $link = isset($attr[‘link’]) && ‘file’ == $attr[‘link’] ? wp_get_attachment_link($id, $size, false, false) : $linkMod;//wp_get_attachment_link($id, $size, true, false);`

    the first 3 are new code
    the 4th is a modification of the original line

    if [gallery link="file"] there’s no change of behavior

  • The topic ‘Gallery Shortcode linking somewhere else’ is closed to new replies.