Yearly events view for tribe calendar – sorted by month

wordpress-event-calendarA customer asked me a specific page with all events displayed for the famous Event Calendar Plugin. Nothing hard here : I created a custom page template with the following code - does the job... note that this is for ENFOLD wordpress theme stylesheet but you can easily adapt to other column frameworks like visual composer...

 

$all_events = tribe_get_events(
array(
 'eventDisplay'=>'upcoming',
'posts_per_page'=>-1,
'order' => 'asc'
)
);
foreach($all_events as $post) {
setup_postdata($post);
$month =  tribe_get_start_date(null, false, "F Y");

?>

<article class='post-entry post-entry-type-page <?php echo $post_class; ?>' <?php avia_markup_helper(array('context' => 'entry')); ?>>
 <? if ($oldmonth!=$month) {$oldmonth=$month;?>
<div class="flex_column av_one_third first  avia-builder-el-0  el_before_av_two_third  avia-builder-el-first  ">
<section class="av_textblock_section" itemscope="itemscope" itemtype="https://schema.org/CreativeWork">
<div align="right"><h2><?= ucfirst($month)?></h2> 
</div> </section></div><?}?>


<div class="flex_column av_one_third first  avia-builder-el-0  el_before_av_two_third  avia-builder-el-first  ">
<section class="av_textblock_section" itemscope="itemscope" itemtype="https://schema.org/CreativeWork">
<div align="right">
<h4><a href="<?=get_permalink()?>">du <?=tribe_get_start_date(null, false, "d/m/Y")?> au <?=tribe_get_end_date(null, false, "d/m/Y")?>  </a></h4>
</div> </section></div>

 
 
 <div class="flex_column av_two_third   avia-builder-el-2  el_after_av_one_third  el_before_av_one_third  "><section class="av_textblock_section" itemscope="itemscope" itemtype="https://schema.org/CreativeWork">
 <h4><a href="<?=get_permalink()?>"><b><?= get_the_title() ?> </b></a> </h4>
 <?=get_the_excerpt();?></section></div>


			<div class="entry-content-wrapper clearfix"></div></article>
<?
}
                    ?>

 

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *