Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm building a theme which includes displaying images which are not embedded in the body of the post by the user.

I understand the correct approach to this is to use the concept of attached images - ie. that images uploaded on a particular post edit page are associated with the post in the DB.

What I don't understand is WordPress has such meager support for this seemingly essential functionality. It is very poorly supported in the admin area - you cannot remove or view attachments, or attach a file that is already uploaded.

Am I missing something? Is there a plugin to solve this problem.

share|improve this question
add comment

1 Answer

Wordpress doesn't have the innate functionality to enumerate attachments as is. Although any attached images can be viewed in the Media Library.

In the Media Library, you'll notice the list of images that are attached to a post have that attribute under the "Uploaded to" column. In that column, lets say for example an image was uploaded as a Featured Image for a post, you'll see it has the attribute of the post name.

Images that are not attached will have the (Unattached) attribute, and you'll also see an Attach link that brings up a window where you can select existing posts/pages to attach. This does works for images that are already uploaded, however it can only be done one image at a time.

Once images are attached, I'd assume your theme would need to have the functionality to display those attached images via a shortcode within the post body, or manage it via a built in gallery plugin or third party gallery plugin.

3rd party gallery plugins generally make a folder for their own uploads and have an admin page or shortcodes to manage those images. NextGEN Gallery is one example.

I too have seen this as a minor flaw in Wordpress, and Wordpress' ability to simply upload images, save them as a gallery and have them "automatically" attached to a post without being able to edit those per-post attachments separately is really quite unpolished.

Hope I would've shed some light from my perspective on your question.

Cheers.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.