Hi @freshmint,
I have never used Events Manager… can you help me out and let me know what the <?php echo do_shortcode('[event]#_{l, F jS} | #_12HSTARTTIME[/event]');?> shortcode does?
Cheers,
EM has its own placeholder tags that you use in their editor: for example #_12HSTARTTIME outputs the event start time and #_{l, F jS} outputs a php date.
In order to use the placeholders in a template setting you have to wrap them in the [event][/event] shortcode ie: [event]#_12HSTARTTIME[/event].
This all seems to be working as the posts are outputing a date, the problem is that each group of three is repeating the same date of the first post in the group. Not sure if there was a some sort of wp_reset_postdata I needed to use to clear out the data in the repeater. Seems to be limited to the Events manager as I tried a test using Advanced Custom Fields and everything worked fine.
Check out the staging site to see a live example http://cftarts.staging.wpengine.com/
Ok makes sense.
I will take a guess that the issue is around the l, F jS date tag.
Can you try declaring global $post at the opening of your repeater template?
Dang, no luck there, I tried using some other tags and removing the date reference but it was the same. here is my full repeater code
<?php global $post ?>
<li class="event-block">
<span class="event-link">
<a class="event-tmb" href="<?php the_permalink(); ?>">
<?php
if ( has_post_thumbnail() ) {
the_post_thumbnail('event-thumb');
} else {
echo '<img class="noimg" src="http://thecenterforthearts.dev/wp-content/uploads/2017/04/cfta-logoicon-w.jpg" />';
}
?>
</a>
<div class="event-cnt">
<div class="event-date"><?php echo do_shortcode('[event]#_{l, F jS} | #_12HSTARTTIME[/event]');?></div>
<h2 class="event-name"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<a class="event-btn" href="<?php the_permalink(); ?>"><i class="fa fa-ticket" aria-hidden="true"></i> Get Tickets</a>
</div>
</span>
</li>
Yea I’m not sure. Everything looks good to me.
There must be another way to the get event date… a date function vs shortcode?