WordPress.org

Forums

Attachments in 2.6? (4 posts)

  1. adamohern
    Member
    Posted 6 years ago #

    Hi folks:

    I'm hoping to find a way of easily "attaching" images to a given post, but without inserting them into the body of said post (I'd rather be able to call them independently of the post body). Is this possible in wp 2.6? Are media-gallery images associated with the post in any way that I can take advantage of?

    Thanks!
    Adam

  2. Are media-gallery images associated with the post in any way that I can take advantage of?

    Yes, images that you upload/attach to a post are children of that post, whether you insert them into the post itself or not.

    WordPress makes post attachments. When you're editing a post and use the uploader, every file you upload gets its own attachment post, with the post_parent set to the original post ID.

  3. adamohern
    Member
    Posted 6 years ago #

    Sounds perfect! How would I access attached posts ("child" posts?) from a theme? Do I need a custom query, or is there an easier way?

    Thanks again!

  4. adamohern
    Member
    Posted 6 years ago #

    Ah, looks like get_children is what I was after. Much obliged!!

Topic Closed

This topic has been closed to new replies.

About this Topic