Events Manager
Using placholders with template tags (11 posts)

  1. roguecat
    Posted 4 years ago #

    In the documentation under Placeholders it says:

    You can use this syntax both in the Events Manager Settings page and in the template tags that you might insert in your theme templates (emphasis mine).

    Is there an example of how to use the placeholders with the template tags?



  2. agelonwl
    Posted 4 years ago #

    In template file e.g. event-single.php you can do like

    global $EM_Event;
    then to call a placeholder
  3. roguecat
    Posted 4 years ago #

    This is very helpful. Will follow-up with how I've used it. Thanks!

  4. matmancini
    Posted 4 years ago #

    is it possible to do this in the regular single-event.php?

  5. scharc
    Posted 4 years ago #

    have a look at this : http://pastebin.com/c4zaNyJL its my single-event.php

    you have to copy the template folder to your themefolder ... ;)

  6. matmancini
    Posted 4 years ago #

    Thank you :)
    I found the solution!

    I create a new Object with the post id and then use the output function tu run the placeholders.

    $event = new EM_Event($post->ID);
    echo $event->output('#_EVENTNAME');
  7. scharc
    Posted 4 years ago #

    you dont have to creat a new object, just global the existing one!

    and you dont have to run every placeholder through the output() function... just grab everything and put that into the output function...

    but if its working for you... great!

  8. matmancini
    Posted 4 years ago #

    i did it because im using a custon theme and the global object returns false :(
    didnt know why?

  9. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 4 years ago #

    better yet, use this function

    em_get_event(id, searchby)

    id is either event or post id and searchby default is 'event_id' and can be 'post_id'. this function checks the globals and uses the WP cache as well.

  10. zandercent
    Posted 3 years ago #

    this really needs more documentation - I'd really like to be able to make my own templates - but can't get my head round the conditionals

  11. agelonwl
    Posted 3 years ago #


    can you give more details on the template that you've wanted?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic