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.

Image galleries display those images that were uploaded to that post, by default. If I wanted to move an image to a different post, so it appeared there instead, would I have to delete and re-upload? Or, is there a way to re-assign an image that's already in the Media Library?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

This works for me: http://wordpress.org/support/topic/detach-amp-re-attach-media-attachment-images-from-posts#post-1609173

I've saved this as a snippet in my IDE for use in projects. Very handy!

share|improve this answer
    
NICE, man! I'll try this! –  Isaac Lubow Sep 21 '11 at 6:43

If the image is in a Gallery you would need to delete it, or exclude it inside the short-code for the gallery.

If it's a single image you could just delete it from that page (not from the media manager). It could be used inside a different page by uploading it.

I'm not aware of a simple way to remove single images from galleries (without excluding it with short-code). I tried the link that posted by:Brian Fegter. It did add a re-attach button but I don't see how that is relevant to this specific question.

share|improve this answer
    
It's relevant to the question in that it reassigns the post_parent column and therefore removes it from the gallery functionality of the original post. The gallery grabs the child attachments of that specific post (via post_parent). If that image's post_parent has changed, Wordpress does not include it in the original post gallery. –  Brian Fegter Sep 21 '11 at 7:32
    
I didn't try that. If it works I apologize and I'll return to +1 your answer. I've been cursing the default gallery for the lack of control over gallery images. –  Jeremy Jared Sep 21 '11 at 9:35
    
No worries Jared. There are major changes coming to the media management in a future release. I too share your frustrations. One such frustration is if a post thumbnail is set, why does it get placed in the gallery? If a theme displays the thumb, it's displayed a second time in the gallery. Arg :) –  Brian Fegter Sep 21 '11 at 9:45
    
I stand corrected. It does work. It would be nice to have a way to remove an image directly from the gallery panel, but this will do until or if that happens. Thanks for the tip! –  Jeremy Jared Sep 21 '11 at 9:45

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.