Title: listing attachment_category
Last modified: August 21, 2016

---

# listing attachment_category

 *  Resolved [Trevsweb](https://wordpress.org/support/users/trevsweb/)
 * (@trevsweb)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/listing-attachment_category/)
 * Hi, I’m trying to list all of the attachment_category items in a list
    I was 
   hoping to do the same kind of scrutinising that WordPress offers in its category
   sorting and modifying query.
 *     ```
       <?php
          $categories = get_attachment_category();
         	foreach ($categories as $category) {
       		 echo $category->name;
             }
       ?>
       ```
   
 * I want to be able to list attachment children to eventually to be used in a dropdown
   menu such as
 * `<option value='<?php echo $page->parent_name; ?>'><?php echo $page->category_name;?
   ></option>`
 * I might be making too much work for myself, now others, but I’m hoping someone
   can help me list those attachment categories first. 🙂
 * [http://wordpress.org/extend/plugins/media-library-assistant/](http://wordpress.org/extend/plugins/media-library-assistant/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/listing-attachment_category/#post-3909541)
 * If what you want is a list of the terms defined for the **Att. Category** taxonomy,
   I suggest this WordPress function:
 * [Get Terms](http://codex.wordpress.org/Function_Reference/get_terms)
 * which has all kinds of optional arguments. If you want the terms associated with
   a particular attachment, you can use something like:
 * `$terms = wp_get_object_terms( $item->ID, $taxonomy );`
 * (see [get object terms](http://codex.wordpress.org/Function_Reference/wp_get_object_terms))
 * If I have missed the point, give me a more detailed explanation of what you’re
   after and I will be more helpful.
 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/listing-attachment_category/#post-3909624)
 * I hope the suggestions I gave you a few weeks ago got you started on meeting 
   your requirements. I’m going to mark this issue resolved for now, but feel free
   to re-open it if you have problems or more specific questions.
 * Thanks for your interest in the plugin.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘listing attachment_category’ is closed to new replies.

 * ![](https://ps.w.org/media-library-assistant/assets/icon-256x256.png?rev=973502)
 * [Media Library Assistant](https://wordpress.org/plugins/media-library-assistant/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/media-library-assistant/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/media-library-assistant/)
 * [Active Topics](https://wordpress.org/support/plugin/media-library-assistant/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-library-assistant/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-library-assistant/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [David Lingren](https://wordpress.org/support/users/dglingren/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/listing-attachment_category/#post-3909624)
 * Status: resolved