Title: Can&#039;t retrieve attachments
Last modified: August 20, 2016

---

# Can't retrieve attachments

 *  [Bilal Shahid](https://wordpress.org/support/users/bilalvirgo10/)
 * (@bilalvirgo10)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/cant-retrieve-attachments/)
 * Hello there,
    I’m currently working on a theme. But the problem is that whenever
   I try to get attachments to the post by using the function get_children() and
   get_posts(), it doesn’t work for post format **Image** and **Gallery**. However
   it works fine for **standard post format**. The code I use inside the loop is
   as follows:
 *     ```
       $children =& get_children(array(
           'post_type' => 'attachment',
           'post_parent' => $post->ID
       ));
       ```
   
 * Waiting for the help,
    thanks in advance 🙂

The topic ‘Can't retrieve attachments’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Bilal Shahid](https://wordpress.org/support/users/bilalvirgo10/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/cant-retrieve-attachments/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
