• Resolved K-lol

    (@k-lol)


    Hi,

    I think I need your help ^_^

    It’s possible to use the Placeholders in a php Page?

    That’s work:
    <?php echo $EM_Category->output("#_CATEGORYNAME"); ?>

    That not…
    <?php echo $EM_Events->output("#_EVENTNAME"); ?>

    Do you have a track to help me?
    Thank you so much
    Have a nice day.

    Wordpress : 4.8.1
    Event Manager : 5.7.3

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Try

    <?php global $EM_Event; echo $EM_Event->output(#_EVENTNAME"); ?>

    $EM_Events is incorrect, do not use the plural. 😉

    I’m “just” a EM user myself, but I did create a lot of custom placeholders to be used all over the website.

    If you want to output more events you need to work with the foreach statement.

    Thread Starter K-lol

    (@k-lol)

    Oh thank you so much for you quickly answer!

    For the moment, your code doesn’t work… Also with the ” before #_EVENTNAME

    I’ve nothing displayed…

    I continue to search. Thank you

    Sorry… it is (“#_EVENTNAME”) of course. 😉

    Where are you trying to echo this code? It only works in is_singular(‘event’) normally, but you can hook into that. I’m guessing it’ll probably just be much easier to use a shortcode in the WordPress Page editor, though. Depending on what you need to display.

    If you are trying to display an Event in a non-event page, EM doesn’t know where to get it’s info, of course. You would need to code that in as well. A standard shortcode like [events_list limit=”1″]#_EVENTNAME <br/>[/events_list] might well do the trick. The mentioned code will echo the first upcoming event. The “#_EVENTNAME <br>”-part can be altered into anything so it will display exactly the output you want. 😉

    Thread Starter K-lol

    (@k-lol)

    Here is my problem ^_^

    I would like to post my events in a php page.

    All categories, all events…

    So it is not possible?
    In a template?

    Yes, that it possible. I find anything can be accomplished with this great plugin. LOL. 😉

    The thing is, that if you do this outside of WordPress, the EM hooks are not in the WP loop. You can accomplish this, but why do so much work, right? 😉 Do you want to display this output in a different php format? Then why not would use a template file (theme based, just like post.php and page.php)?

    Within WordPress you can then create a new post/page using the new template php file (select in the Page Attributes meta box on the right) to filter out or add things like sidebars, full-width, header, footer, etc. In the WordPress Post Editor you can then simply use shortcodes and conditional placeholders to display anything you want/need.

    [events_list]
    [category_list]
    [location_list]
    etc.

    As these shortcodes are already in EM itself, I would not recommend recreating them yourself.

    Thread Starter K-lol

    (@k-lol)

    I’ve been looking too far … ^_^

    It makes sense when you explain it to me …

    sorry to disturb you…

    And thank you for your time!

    Not a problem! Here to help out. 🙂

    Could you mark this as resolved, please?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Placeholder in a php page’ is closed to new replies.