Uploading multiple post images
In this post we will see how to upload multiple post images Recently, when I was working on one of my projects, I needed to add a feature to enable user to upload multiple images for to a post/page. Although there are quite a few plugins available in wordpress plugin directory, I could not find any to best suite my needs. This inspired me to write my own plugin AOC Multiple Post Images.
This plugin presents and interface as shown in picture to upload image
Upon clicking the link (Add another image), you are presented with a similar file upload interface as displayed when selecting featured image, where you can either select an uploaded image or upload a new image. Once an image is uploaded, it will be shown as below image
You can delete an uploaded image by clicking X button in the image box.
Displaying uploaded multiple post images
Once you have uploaded the images and updated the post, you can access the images that are attached to this post by using following function in your template files
aoc_get_images($post_id)//$post_id will be id of the post whose images are to be fetched.
This function will return an array of urls for all the images uploaded to the post.