WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Event Manager plugin. I want to use many of the shortcodes via php code. e.g [events_calendar]

share|improve this question

closed as off-topic by Pieter Goosen, Mayeenul Islam, Mark Kaplun, toscho Dec 18 '14 at 19:00

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 1 down vote accepted

In general, you can do any shortcode with do_shortcode() (see codex). But if they have a template function available, its probably best to use that.

 echo do_shortcode('[events_calendar]');
share|improve this answer
thanks dude its working and now I can use any shortcode. – Bhuvnesh Gupta Jan 17 '13 at 12:05
now one more problem is there. do_shortcode('[events_calendar]'); this is working fine but I want to use <?php echo do_shortcode('[events_calendar long_events=1]') . it's not working – Bhuvnesh Gupta Jan 17 '13 at 12:15
@Bhuvnesh It should work. You can pass attributes like that with do_shortcode. A bug with the plug-in perhaps? Probably best to ask them on the plug-in forums as there's not much else to add here :). – Stephen Harris Jan 17 '13 at 14:54
Perhaps set the value in double quotes, like '[events_calender long_events="1"]' – bueltge Jan 17 '13 at 22:48
@StephenHarris yes, you are right on default. But I had seen not seldom, that plugin developers filter the data a little bid wrong. – bueltge Jan 23 '13 at 11:49

I think em-template-tags.php may have what you're looking for


Per Events Manager's documentation, template tags can be found within the file em-template-tags.php, which is in the root of the plugin directory.

For example, [locations_list $atts] would have the corresponding template tag em_locations(). I just tried this example on a clean WP 3.5 install and the results are the same.


Alternatively, you can just call the function to which the shortcode is hooked. em-shortcode.php, also in the plugin root, has all of the shortcodes and corresponding functions in it.

For your example of [events_calendar], <?php echo em_get_calendar_shortcode(); ?> displays the calendar just as the shortcode would.

share|improve this answer

Specific Events Manager template tags are another way to achieve this, for example:

echo EM_Events::output(array('scope'=>'tomorrow', 'limit'=>10, ));

You can use any of the attributes. (http://wp-events-plugin.com/documentation/event-search-attributes/)

One of the attributes is, 'format', which formats the output and lets you use html and all the placeholders (http://wp-events-plugin.com/documentation/placeholders/) and conditional tags.

So you can do this:

echo EM_Events::output(array('scope'=>'tomorrow', 'limit'=>10, 'format'=>' 


share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.