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

  1. jeremi_liwanag
    Posted 2 years 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 class="news-title"><a href="<?php the_permalink(); ?> ">
                  <?php the_title( '<h2>', '</h2>' ); ?>
                <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 class="events-loc">
                	<span>Location:</span> <?php echo do_shortcode('[locations_list]'); ?>

    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'); ?>

    thanks a lot


  2. angelo_nwl
    NetWebLogic Support
    Posted 2 years ago #


    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
    Posted 2 years 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.


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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic