Title: multiple cats in shortcode
Last modified: August 21, 2016

---

# multiple cats in shortcode

 *  Resolved [darksteir](https://wordpress.org/support/users/darksteir/)
 * (@darksteir)
 * [12 years ago](https://wordpress.org/support/topic/multiple-cats-in-shortcode/)
 * hello,
    i need to have all media from two slug like this.
 * echo do_shortcode(‘[mediacat cats=”veloce,brochure” orderby=”date” order=”DESC”]’);
 * the sortcode juste give me all the medias from veloce and i want all media who
   have veloce and brochure in common.
 * [https://wordpress.org/plugins/media-category-library/](https://wordpress.org/plugins/media-category-library/)

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

 *  Thread Starter [darksteir](https://wordpress.org/support/users/darksteir/)
 * (@darksteir)
 * [12 years ago](https://wordpress.org/support/topic/multiple-cats-in-shortcode/#post-4965520)
 * if i try that i use the same problem
 *     ```
       <?php
          $posts = $media_cat_lib->get_mediacategory_shortcode(array('returnposts'=>1,'cats' =>'helioc2','orderby' =>"slug",'order' => "DESC" ) );
       ?>
       <?php
       foreach($posts as $rpost):
       ?>
       <h1 id="opj">
       <a target="_BLANK" href="<?php echo wp_get_attachment_url( $rpost->ID);?>">
       <?php
       echo get_the_title($rpost->ID);
       ?>
       </a>
       </h1>
       <?php
       endforeach;
       ?>
       <?php
       endif;
       ?>
       ```
   
 *  Plugin Author [timmcdaniels](https://wordpress.org/support/users/timmcdaniels/)
 * (@timmcdaniels)
 * [11 years, 12 months ago](https://wordpress.org/support/topic/multiple-cats-in-shortcode/#post-4965687)
 * Hi darksteir,
 * Version 2.1 will allow this by using the operator option:
 * [mediacat cats=”veloce,brochure” orderby=”date” order=”DESC” operator=”AND”]
 * Thanks,
 * Tim
 *  [JakeDH](https://wordpress.org/support/users/jakedh/)
 * (@jakedh)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/multiple-cats-in-shortcode/#post-4965759)
 * Hi,
 * Is this possible on the frontend search form too?
 * At the moment, if I click multiple categories, it brings up the same issue as
   darksteir, where it brings up all the media from veloce and brochure, and not
   just the media that have veloce and brochure in common.
 * Thanks,
    Jake

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

The topic ‘multiple cats in shortcode’ 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/)

 * 3 replies
 * 3 participants
 * Last reply from: [JakeDH](https://wordpress.org/support/users/jakedh/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/multiple-cats-in-shortcode/#post-4965759)
 * Status: resolved