+ Reply to Thread
Results 1 to 1 of 1

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

  1. #1
    diabolo's Avatar
    diabolo is offline Community Advocate diabolo is on a distinguished road
    Join Date
    Nov 2007
    Location
    Jersey Shore
    Posts
    1,683

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

    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 Code:
    <?php if(function_exists(do_shortcode('[mediacategories categories="6"]'))) { ?>
      <h1>Inspiration</h1>
    <?php
      do_shortcode
    ('[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 by diabolo; 02-22-2011 at 08:02 PM.

+ Reply to Thread

Similar Threads

  1. How to call js function from php code
    By kundamor in forum Programming Help
    Replies: 5
    Last Post: 11-25-2008, 04:18 AM
  2. Call to undefined function curl_init()
    By jbajwa1 in forum Free Hosting
    Replies: 1
    Last Post: 11-20-2008, 05:53 PM
  3. Call to undefined function domxml_open_file()
    By phpasks in forum Programming Help
    Replies: 6
    Last Post: 09-04-2008, 01:52 AM
  4. Call to undefined function
    By galaxyAbstractor in forum Free Hosting
    Replies: 1
    Last Post: 04-30-2008, 11:43 AM
  5. Call to a member function ..... ERROR :@
    By mehdi in forum Free Hosting
    Replies: 7
    Last Post: 08-09-2007, 10:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers