Open andrewryno opened 11 years ago
for me later to reference (combining the three issues):
and
if ( ! function_exists( 'get_attached_media' ) ) {
$attachments = get_attached_media( 'image', $post->ID );
}
after playing with this a bit - this only gets images that are attached to the post meaning if it was originally uploaded to that post/page. If an image is added to the content from the media library this won't pull it. If there was an image uploaded to a post and the image was removed as featured post or removed from content this will still pull that image. Ergo... it doesn't work for what we need it to.
This should allow us to grab all images in the post, whether they are in a gallery or included directly in the post content.