Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $post_id = $post->ID;
- $cover_img = get_post_meta($post_id, 'event_image_cover', true );
- if(!empty($cover_img)){
- echo '<div class="banner_event_box_image" style="background-image:url('.$cover_img.')"></div>';
- }
- else{
- $src = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), 'medium' );
- echo '<div class="banner_event_box_image" style="background-image:url('.$src[0].')"></div>';
- }
- ?>
- <div class="banner-featured-tticon">
- <div class="banner-heading-header">
- <h3><span><i class="fas fa-star"></i></span>Featured Event</h3>
- <h5><a href="<?php echo get_the_permalink($post->ID);?>"><?php echo get_the_title($post->ID);?></a></h5>
- </div>
- <div class="banner-heading-container">
- <?php
- $terms_organize = get_the_terms( $post->ID , 'event_organizer' );
- if ( $terms_organize != null ){
- foreach( $terms_organize as $term_organize )
- {
- echo '<p><i class="fas fa-street-view"></i><span>…</span> '. $term_organize->name . '</p>';
- }
- }
- ?>
- <?php
- $locations = get_the_terms($post->ID, 'event_location');
- if (!empty($locations)) {
- foreach ($locations as $location) {
- echo '<p><i class="fas fa-map-marker-alt"></i><span>…</span> '. $location->name .'</span>';
- }
- }
- ?>
- <?php
- //Event Categories
- $terms = get_the_terms( $post->ID , 'event_type' );
- $termcount = count($terms);
- $termcount = $termcount -1;
- if ( $terms != null ){
- foreach( $terms as $term ) {
- if($count == 0)
- {
- $termcount = $termcount > 0 ? ' +' . $termcount : '';
- }
- echo '<p><i class="fas fa-folder"></i><span>…</span> '. $term->name .' '.$termcount.'</p>';
- $termcount = '';
- $count++;
- }
- }
- ?>
- </div>
- </div>
Add Comment
Please, Sign In to add comment