WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
Using placholders with template tags (11 posts)

  1. roguecat
    Member
    Posted 2 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?

    Thanks.

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 2 years ago #

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

    global $EM_Event;
    
    then to call a placeholder
    
    $EM_Event->output("#_BOOKINGFORM")
  3. roguecat
    Member
    Posted 2 years ago #

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

  4. matmancini
    Member
    Posted 2 years ago #

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

  5. scharc
    Member
    Posted 2 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
    Member
    Posted 2 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
    Member
    Posted 2 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
    Member
    Posted 2 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 2 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
    Member
    Posted 2 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
    Member
    Posted 2 years ago #

    Hi,

    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

About this Topic