Ferdie Santiago
September 3, 2014 at 12:36 am
<?php
$atts = array(
‘title’ => NULL,
‘limit’ => 100,
‘css_class’ => NULL,
‘show_expired’ => FALSE,
‘month’ => NULL,
‘category_slug’ => NULL,
‘order_by’ => ‘start_date’,
‘sort’ => ‘ASC’
);
// run the query
global $wp_query;
$wp_query = new EE_Event_List_Query( $atts );
if (have_posts()) : while (have_posts()) : the_post();
?>
<div class=”over-layer text-center”>
<p class=”a1 nsize text-center”><?php the_title(); ?></p>
<p class=”a2 ssize text-center”><?php the_date(); ?> </p>
</div>
Hi ,
i have tried to create an event that has multiple events, i tried to duplicate the event but having different date and time.
but when i try to run the code above, the_date(); it displays the date when the event is registered..
is there a way on how to query the startdate of the event that i registered?
EXAMPLE
EVENT NAME:
1) BUSINESS CLINIC
EVENT STARTDATE :
SEPTEMBER 03, 2014
EVENT STARTDATE :
SEPTEMBER 05, 2014
id like to get the startdate of the event that i mentioned above.
please help thanks.
Ferdie Santiago
September 3, 2014 at 1:25 am
Add New Note to this Reply
im using EE4 btw.
Dean
September 3, 2014 at 5:44 am
Add New Note to this Reply
Hi,
I would take a look at this example query here: https://gist.github.com/joshfeck/e3c9540cd4ccc734e755
(you might be already but your code seemed to cut short).
With that you can query each post and get the start date that way (var_dump($post) is useful here as it will tell you what’s available).
E..g you could use
echo $post->DTT_EVT_start;
Though that will give you a raw date so you will likely need to strtotime() and date() it.
Ferdie Santiago
September 3, 2014 at 8:20 pm
Add New Note to this Reply
Hi Dean,
thx for the info. it helps me broaden my knowledge about the post you’ve shared.
it such a pleasure to have your ideas. thanks for sharing again.
case closed.