• Resolved _siws_

    (@_siws_)


    Hi,

    I’am building my page on WordPress 3.7.1 and I have problem with getting meta data (image title and description). I would like hook lightbox (jackbox) to my gallery so i must change some code in default gallery becouse. I must add to class=”jackbox” data-title=”$image title” and data-description=”$image_description”. I found function to add class=”jackbox”

    function my_get_attachment_link($html) {
    $postid = get_the_ID();
    $html = str_replace('<a', '<a class="jackbox" data-group="info" data-title="'.$img_title.'"', $html);
    return $html;
    } add_filter('wp_get_attachment_link', 'my_get_attachment_link', 10, 1);

    when i add class=”jackbox” i tried add data-title=”$img_title” but i cant generate image meta data.

    Best Regards
    Michal

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘get image meta data from gallery in functions.php’ is closed to new replies.