Forum Replies Created

Viewing 1 replies (of 1 total)
  • Responsive Lightbox is great, but not being able to display a caption is a significant drawback. Christian’s code is helpful, but I wanted to display the Alt text field and not the title field. I modified the code to the following:
    function modify_attachment_link( $html, $id ) {
    $att_alt = get_post_meta($id, ‘_wp_attachment_image_alt’, true);
    $html = str_replace( ‘<a href’, ‘<a title=”‘.$att_alt.'” href’, $html );
    return $html;
    }
    add_filter( ‘wp_get_attachment_link’, ‘modify_attachment_link’, 10, 2);
    Placed it in functions.php and it works well with swipeBox setting.

Viewing 1 replies (of 1 total)