Event Calendar Incorrect Date tribe_get_start_date

Posted in: Newspaper
Post count: 4

Hi,

This is a bit of stretch, but I’m hoping someone on support or maybe another user has some previous experience with displaying the correct event date for The Event Calendar by Tribe on the Newspaper homepage.

Editing parts of td_module_1.php and by using filters, I’m able to display the post type tribe_events in the Newspaper layout Pagebuilder + latest articles + pagination. I can display the correct date in the Homepage latest articles section (bottom loop just before pagination) and in a widget but in Blocks, all I get is the current date. This is the code I’m using to display the date:

<?php echo tribe_get_start_date($post->ID, false, ‘l, F jS, Y’); ?>

From a few things I read over at The Event Calendar’s forum, a new loop is needed but I really don’t know how to do it in the Newspaper theme. Any help would be greatly appreciated!

thanks!

Post count: 22421

Hello,

I looked into this a little bit and found some interesting results. Bare in mind that the plugin is not tested with our theme:
If the block is set to display posts as well as events, it displays the event time and on posts the post time: http://screencast.com/t/7ezlWVOuuhttp://screencast.com/t/BGy1sBIjI
If it is set just to events it does not display the event time but rather the posting time: http://screencast.com/t/qoJ52Wbz
If you want to set the block to just pick up events, and get it to work you could adjust your code a little bit like so:
<?php echo tribe_get_start_date($this->post->ID, true, 'l, F jS, Y'); ?>
and remove the standard get_date code for this module: http://screencast.com/t/lGmjCLiT8d

I hope this helps.
Thank you!

  • This reply was modified 10 years by Bogdan B..
Post count: 4

You did it! That worked perfectly! Thank you so much!

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.