-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcontent-event_list.php
44 lines (27 loc) · 1.15 KB
/
content-event_list.php
1
<?php $event_id = get_the_ID(); $event_type = get_post_meta($event_id, 'event_type', true); $permalink = get_post_permalink(); $date_mbl = get_post_meta($event_id, 'event_datetime_start', true);?><article id="post-<?php the_ID(); ?>" <?php if($event_type): post_class("$event_type"); else: post_class(); endif; ?>> <header class="entry-header"> <h2 class="entry-title"><a href="<?php echo esc_url($permalink); ?>"><?php the_title(); ?></a></h2> </header><!-- .entry-header --> <?php if($date_mbl && is_numeric($date_mbl)): $date_mbl = date_i18n('d F Y', $date_mbl); echo '<div class="date-mobile">'. $date_mbl .'</div>'; endif; ?> <div class="entry-content <?php if($event_type) : echo esc_attr($event_type); endif;?>"> <?php $content = get_the_content(); $trimmed = wp_trim_words( $content, $num_words = 40, $more = null ); echo $trimmed; ?> <div class="buttons <?php if($event_type) : echo esc_attr($event_type); endif;?>"> <a href="<?php echo esc_url($permalink); ?>" class="btn read-more"><?php _e('Read More','openlab-txtd') ?></a> </div> </div><!-- .entry-content --></article><!-- #post-## -->