does vanilla wordpress have a way to create attachment/child posts?

does plain Jane vanilla WordPress site have the ability to create posts that are children or attachments of other posts. I am seeing code in a theme that selects the children of a post where the post type is attachment. I am wondering how to create these attachments for how to edit the already existing attachments? Is this native to WP or is this functionality only available via some sort of plugin?

$attachments = get_children(array('post_parent' => $post->ID,
'post_status' => 'inherit',
'post_type' => 'attachment',
'post_mime_type' => 'image',
'order' => 'ASC',
'orderby' => 'menu_order ID'));

  • Patrick
    • Support Monkey

    Hi there @nathan

    Welcome to the forums, glad to have you aboard!

    That is default WordPress code that is used to fetch images attached to a post. It is used when creating an image gallery shortcode.

    If it is present in your theme, it is likely part of a filter that the theme author has coded to make image galleries look better in that theme.

    I hope this helps! And thanks for being a member :slight_smile:

  • Patrick
    • Support Monkey

    Hi again @nathan

    Ooh, I just found a super-duper plugin that enables you to do that and a whole bunch more cool stuff with your media:

    You can attach media items to any post with a single click (1st screenshot).

    You can see in the 2nd screenshot below that there is no image in the post editor, but an image (camera) has been attached to the post and can be manipulated in any way you like in the File Gallery metabox under the post editor.

    If there is any particular reason my previous post warranted an "Unhelpful" vote, please let me know so I can improve the support offered.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.