WordPress get_children() not working with posts that are not standard types

asked Feb 14, 2013 in Website Builder by SunFun (3,000 points)
Hello there,
 when I try to get attachments of a specific post with a post format that is not standard I get an empty array. However when I use the same exact code with standard post types, it works just right returns all the right attachments.
This is the code I am using  inside the loop:
$children = get_children(array(
      'post_parent' => $post->Cus_ID,
      'post_type' => 'myattachment'

If anyone can help me out, I would be greatful.
Thanks and regards,

1 Answer

0 like 0 dislike
answered Feb 14, 2013 by expert (14,380 points)
I think your code is fine and your problem is not there. Make sure that your image is attached to the post itself. Go to edit  post, and click on the  "Add Media" option and select  "Uploaded to this post", and  the image should appear here