WordPress.org

Forums

Detached image files? (15 posts)

  1. asefredrikson
    Member
    Posted 2 years ago #

    Hello,

    After a wordpress blog move, several of my photos was detached from posts using the Gallery function. They appear in the Media gallery but are not attached to a post anymore. Anyone know why this happened and what to do about it? I now have over 4000 pictures detached :((

  2. makethea
    Member
    Posted 2 years ago #

    Hello,

    How have you been attaching photos before the WordPress blog move?

    If you have been posting in the Media Library, the photos will not be attached to any posts. Only when you upload a medium in a post can you attach.

    The Gallery function only extracts, not really deletes. Maybe you have deleted an attribute from shortcode that may have cause a deletion.

    Lauren

  3. asefredrikson
    Member
    Posted 2 years ago #

    Thank you for your reply Lauren!
    OK, I see what you mean. The problem I have is that after the move, all my posts that I used [gallery link="file"] doesn't contain any photos anymore. However I find the photos in the media gallery but they don't appear in the posts anymore.

  4. makethea
    Member
    Posted 2 years ago #

    Maybe, when you moved, you may have changed the domain.

  5. asefredrikson
    Member
    Posted 2 years ago #

    Yes I did, but what went wrong you mean?

  6. asefredrikson
    Member
    Posted 2 years ago #

    Is there anything in the SQL I can change in order to make the galleries work?

  7. makethea
    Member
    Posted 2 years ago #

    In SQL, you may have to update the links for 4, 000 images. But, there should be a PHP code to loop the images from the Media Library.

    Try these links:

    http://codex.wordpress.org/Function_Reference/wp_get_attachment_url

    PHP:

      <?php
      $audios =& get_children( 'post_type=attachment&post_mime_type=audio/mpeg' );
      foreach ( (array) $audios as $attachment_id => $attachment ) { ?>

    • <?php echo wp_get_attachment_link( $attachment_id ); ?>
    • <?php } ?>

  8. asefredrikson
    Member
    Posted 2 years ago #

    Thanks! Ill try that!

  9. Angie Meeker
    Member
    Posted 2 years ago #

    Did this work for you? I think I may have the same problem - http://t.co/DJxcDNFNRZ

  10. esmi
    Forum Moderator
    Posted 2 years ago #

    Why are you using an old copy of WordPress? Were you aware that your site is currently running a very real risk of being hacked. You need to upgrade WordPress asap.

    If you are not using WordPress 3.4.2, then please post a new topic.

  11. Angie Meeker
    Member
    Posted 2 years ago #

    @esmi - Thanks, I know. The old site was 3.4.2. That's the CLIENT's old site - the one we're moving INTO our Multisite install which is up to date. They didn't have anyone maintaining their site for awhile which is why it's out of date - same with their theme - they hadn't changed out their theme back when WP rolled in featured images, custom menus, etc... big updates. So now we're dealing with an upgrade from their site to our install, their theme to ours, from their single site to our multisite. Everything is fine except for this image issue.

    I posted it as 3.4.2 because this site started as a single site that WAS 3.4.2 before we ported it into ours and I thought that might be important. I guess now that it's on ours you can go ahead and change it to 3.5.1.

  12. Angie Meeker
    Member
    Posted 2 years ago #

    @esmi - I know you were talking to the original poster - I had my thread open, too. I thought you were posting there! ;-)

  13. esmi
    Forum Moderator
    Posted 2 years ago #

    This is a 5 month old topic. You'd be better off posting a new one explaining what you are currently trying to do. As you seem to be importing content in a multisite, the Multisite forum might be the best place to ask about this as multisites can be quite different from standalone installs.

  14. Angie Meeker
    Member
    Posted 2 years ago #

    @esmi - I've got a thread already in the How to/Troubleshooting. If I post one in MS, too, will it get deleted?

  15. esmi
    Forum Moderator
    Posted 2 years ago #

    I can't see any recent topics of yours in that forum, so just go ahead and post in Multisite.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags