- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
In the wordpress loop, I’m trying to get an array of images that are used in a blog post but Google has only been showing me old answers that aren’t compatible anymore
http://codex.wordpress.org/Function_Reference/wp_get_attachment_image
The first example should be what you’re looking for.
@Kermet, thanks for the link. That helped me solved what the real issue was. It’s not counting the images in the post as attachments. When you insert an image into a post, it adds it to that posts’ media gallery. The post I was testing this on was only showing one image in it’s media gallery even after I attached more images. Other posts with more images in their media gallery are showing more images.
Do you know why this is?
Yeah, with a bit more testing. Only images uploaded to that specific post are showing up as attachments. Images uploaded to other posts arent counted.
What I’m looking for is an array of images that are actually inserted into the post, and not necessarily uploaded to that specific post.
I use attachments plugin (http://wordpress.org/extend/plugins/attachments/) to attach media to a post, then i can retrieve all the attached media as an array.
You could try that if wordpress’ get_attachment function doesn’t do the trick for you