[WordPress] How to call shortcode function directly and pass $atts

Discussion in 'Scripts, 3rd Party Apps, and Programming' started by diabolo, Feb 22, 2011.

  1. diabolo

    diabolo Community Advocate Community Support

    Likes Received:
    Trophy Points:
    I am using the Media Library Categories plugin. It does not have much documentation, so I have concluded the way to implement it would be using the shortcode [mediacategories categories="6"].

    I want to implement this directly into the theme template. So I have tried:
    <?php if(function_exists(do_shortcode('[mediacategories categories="6"]'))) { ?>
    ('[mediacategories categories="6"]');
    I also tried to implement the function directly, but could not pass the $atts correctly for the function to use them.

    Same post on StackExchange.
    Last edited: Feb 22, 2011

Share This Page