Title: [Plugin: Media Category Library] Long code
Last modified: August 20, 2016

---

# [Plugin: Media Category Library] Long code

 *  Resolved [TSSpkDev](https://wordpress.org/support/users/tsspkdev/)
 * (@tsspkdev)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-media-category-library-long-code/)
 * Hi,
    I’d like to put this into a template but I can’t figure out how it would
   look in php. Can you help?
 *  [mediacat cats=”Documents” orderby=”date” order=”DESC”]
 * Thanks so much,
 * Pamela
 * [http://wordpress.org/extend/plugins/media-category-library/](http://wordpress.org/extend/plugins/media-category-library/)

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

 *  Plugin Author [timmcdaniels](https://wordpress.org/support/users/timmcdaniels/)
 * (@timmcdaniels)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-media-category-library-long-code/#post-3114824)
 * Hi,
 * You can add this to your template:
 *     ```
       <?php if ( method_exists( $media_cat_lib, 'get_mediacategory_shortcode' ) ): ?>
       <?php echo $media_cat_lib->get_mediacategory_shortcode( array( 'cats' => "Documents", 'orderby' => "date", 'order' => "DESC" ) ); ?>
       <?php endif; ?>
       ```
   
 *  Thread Starter [TSSpkDev](https://wordpress.org/support/users/tsspkdev/)
 * (@tsspkdev)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-media-category-library-long-code/#post-3114840)
 * That’s great – thanks to much for the quick response.
 * I need to be more granular.
 * What I really want is to output a bulleted list of titles with the link behind
   it.
 * Is this possible w/ your plugin?
 *  Plugin Author [timmcdaniels](https://wordpress.org/support/users/timmcdaniels/)
 * (@timmcdaniels)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-media-category-library-long-code/#post-3114846)
 * I will be releasing version 0.8 which will allow you to do the following:
 *     ```
       <?php if ( method_exists( $media_cat_lib, 'get_mediacategory_shortcode' ) ): ?>
       <?php $posts = $media_cat_lib->get_mediacategory_shortcode( array( 'returnposts' => 1, 'cats' => "PDF", 'orderby' => "date", 'order' => "DESC" ) ); ?>
       <ul>
       <?php foreach ( $posts as $rpost ): ?>
               <li><a target="_BLANK" href="<?php echo wp_get_attachment_url( $rpost->ID ); ?>"><?php echo get_the_title( $rpost->ID ); ?></a></li>
       <?php endforeach; ?>
       </ul>
       <?php endif; ?>
       ```
   
 * Does that help with what you are trying to do?
 *  Thread Starter [TSSpkDev](https://wordpress.org/support/users/tsspkdev/)
 * (@tsspkdev)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-media-category-library-long-code/#post-3114861)
 * Yes – it’s exactly what I’d like to do.
 * When do expect to release it?
 * Thanks so much!
 *  Plugin Author [timmcdaniels](https://wordpress.org/support/users/timmcdaniels/)
 * (@timmcdaniels)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-media-category-library-long-code/#post-3114862)
 * It was already released this morning.
 *  Thread Starter [TSSpkDev](https://wordpress.org/support/users/tsspkdev/)
 * (@tsspkdev)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-media-category-library-long-code/#post-3114871)
 * It’s up and running and perfect. Thanks you, thank you, thank you!
 *  Plugin Author [timmcdaniels](https://wordpress.org/support/users/timmcdaniels/)
 * (@timmcdaniels)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-media-category-library-long-code/#post-3114874)
 * You are welcome! Thanks for using the plugin.
 *  Thread Starter [TSSpkDev](https://wordpress.org/support/users/tsspkdev/)
 * (@tsspkdev)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-media-category-library-long-code/#post-3114891)
 * In your next round it would be fantastic to give the user an “order” field so
   they could choose the sort order.
 * Really loving this! Thanks so much!
 *  [manoelfilho](https://wordpress.org/support/users/manoelfilho/)
 * (@manoelfilho)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/plugin-media-category-library-long-code/#post-3115068)
 * How do I display the category and subcategory and not repeat the files? If I 
   can only display subcategories is enough. Tank you!

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

The topic ‘[Plugin: Media Category Library] Long code’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/media-category-library.svg)
 * [Media Category Library](https://wordpress.org/plugins/media-category-library/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/media-category-library/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/media-category-library/)
 * [Active Topics](https://wordpress.org/support/plugin/media-category-library/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-category-library/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-category-library/reviews/)

## Tags

 * [media library](https://wordpress.org/support/topic-tag/media-library/)

 * 9 replies
 * 3 participants
 * Last reply from: [manoelfilho](https://wordpress.org/support/users/manoelfilho/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/plugin-media-category-library-long-code/#post-3115068)
 * Status: resolved