WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Show Dates From and To (3 posts)

  1. jeremi_liwanag
    Member
    Posted 7 months ago #

    Hi, i'm using a custom query for my Events. It shows the latest events that was created, works like a normal post..

    <?php $mcc_query = new WP_Query( array( 'post_type' => 'event' ) );
    while($mcc_query->have_posts()) : $mcc_query->the_post(); ?>
    <?php $event = new EM_Event($post->ID); ?>
            <div class="main-news-cont">
              <div class="event-posts">
              <div class="upcoming-date-cont fl">
                  <div class="upcoming-d"><?php echo get_the_date('d'); ?></div>
                  <div class="upcoming-m-y"><?php echo get_the_date('M Y'); ?></div>
                </div>
    
                <div class="news-title"><a href="<?php the_permalink(); ?> ">
                  <?php the_title( '<h2>', '</h2>' ); ?>
                  </a></div>
                <div class="events-time-loc">
                <?php $evt = em_get_events( array( 'post_id' => $ID ) ); ?>
                  <div class="events-time">
                	<span>Time</span>: <?php echo $event->output('#_12HSTARTTIME'); ?> to <?php echo $event->output('#_12HENDTIME'); ?>
                </div>
                <div class="events-loc">
                	<span>Location:</span> <?php echo do_shortcode('[locations_list]'); ?>
                </div>

    I'm wondering since i'm using my own template. How can show the start and end time of the event??

    Here's what i have tried.. sadly it doesnt work.

    <div class="events-time">
                	<span>Time</span>: <?php echo $event->output('#_12HSTARTTIME'); ?> to <?php echo $event->output('#_12HENDTIME'); ?>
                </div>

    thanks a lot

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

  2. angelo
    NetWebLogic Support
    Posted 7 months ago #

    hi,

    try something like this

    $EM_Event = em_get_event($post->ID, 'post_id');
    
    echo $EM_Event->output( get_option('dbem_single_event_format') );
  3. jeremi_liwanag
    Member
    Posted 7 months ago #

    Hi!! Unfortunately It gave me Date/Time/Categories and a Map. Also the information that's being outputted is wrong .. I'm getting 12:00am and 1970's.

    I just want the start and end time.

    Thanks!

    [ Please do not bump, that's not permitted here. ]

Reply

You must log in to post.

About this Plugin

About this Topic