Support » Themes and Templates » Attachments in 2.6?

  • 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

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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.

    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!

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Attachments in 2.6?’ is closed to new replies.