Title: how to access an events date using php code
Last modified: August 20, 2016

---

# how to access an events date using php code

 *  Resolved [omegacoder](https://wordpress.org/support/users/omegacoder/)
 * (@omegacoder)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/how-to-access-an-events-date-using-php-code/)
 * I need to display an events date in events detail page, but this will go in the
   php page file, and not in the settings tab of the events manager plugin. Does
   events manager have this capability?
 * For example, I need to do something like this in my theme functions.php file:
 * <div class=”event-date”>
    <abbr class=”event-date”> <?php ***CODE TO OUTPUT THE
   EVENT DATE HERE*** ?> </abbr> </div><!– .entry-date –>
 * [http://wordpress.org/extend/plugins/events-manager/](http://wordpress.org/extend/plugins/events-manager/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [agelonwl](https://wordpress.org/support/users/angelonwl/)
 * (@angelonwl)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/how-to-access-an-events-date-using-php-code/#post-3200371)
 * maybe this will help (see sample snippets) – [http://wordpress.org/support/topic/events-manager-eventslocation-pages-cant-get-sidebar?replies=20](http://wordpress.org/support/topic/events-manager-eventslocation-pages-cant-get-sidebar?replies=20)
 *  Thread Starter [omegacoder](https://wordpress.org/support/users/omegacoder/)
 * (@omegacoder)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/how-to-access-an-events-date-using-php-code/#post-3200375)
 * thanks very much. For everyones’ reference, I used the following to solve my 
   issue:
 * global $post;
    $EM_Event = em_get_event($post->ID, ‘post_id’);
 * <div class=”entry-meta”>
    <span class=”entry-date”> <abbr class=”published” title
   =”<?php echo $EM_Event->output(‘#_EVENTNAME’); ?>”><?php echo $EM_Event->output(‘#
   F #j#S, #Y’); ?> </abbr> </span> </div><!– .entry-meta –>
 *  Thread Starter [omegacoder](https://wordpress.org/support/users/omegacoder/)
 * (@omegacoder)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/how-to-access-an-events-date-using-php-code/#post-3200376)
 * oh and for events that span more than one day, I changed the above code to:
 * <div class=”entry-meta”>
    <span class=”entry-date”> <abbr class=”published” title
   =”<?php echo $EM_Event->output(‘#_EVENTNAME’); ?>”><?php echo $EM_Event->output(‘#
   F #j#S, #Y #@_{ – F jS, Y}’); ?> </abbr> </span> </div><!– .entry-meta –>

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘how to access an events date using php code’ is closed to new replies.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=3550347)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [omegacoder](https://wordpress.org/support/users/omegacoder/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/how-to-access-an-events-date-using-php-code/#post-3200376)
 * Status: resolved