Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi
    Do’h your right for some reason in my text editor I was seeing line 109 as 209, not sure why opening it a second time and it all comes together so no you are correct, apologies

    Hey thanks for the post most useful however I found I had to add a line to the tag_gallery_get_images() function assigning the value of ID to the images array: $images[$key][‘id’] = $value[‘ID’], see code below for full function.
    Thought I’d post this in case anyone else had the same issue.

    function tag_gallery_get_images($tags) {
    $image_tags = 'media_tags='. $tags;
    $tagged_images = get_attachments_by_media_tags($image_tags);
    if(empty($tagged_images)) return;
    $images = array();
    foreach($tagged_images as $key => $value) {
    	$value = (array) $value;
    	$images[$key] = array();
    	$images[$key]['src'] = $value['guid'];
    	$images[$key]['caption'] = $value['post_excerpt'];
    	$images[$key]['description'] = $value['post_content'];
    	$images[$key]['title'] = $value['post_title'];
    	$images[$key]['id'] = $value['ID'];
    }
    return $images;
    }

    [Moderator Note: Please post code or markup snippets between backticks or use the code button.]

Viewing 2 replies - 1 through 2 (of 2 total)