WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] how to access an events date using php code (4 posts)

  1. omegacoder
    Member
    Posted 1 year ago #

    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/

  2. agelonwl
    Member
    Posted 1 year ago #

  3. omegacoder
    Member
    Posted 1 year ago #

    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 -->

  4. omegacoder
    Member
    Posted 1 year ago #

    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 -->

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.