• Resolved Trevsweb

    (@trevsweb)


    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/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author David Lingren

    (@dglingren)

    If what you want is a list of the terms defined for the Att. Category taxonomy, I suggest this WordPress function:

    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)

    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

    (@dglingren)

    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.