PluginProbe
Import Social Events / 1.2.0
Import Social Events v1.2.0
1.9.1 1.9.0 trunk 1.0.0 1.0.1 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.6.0 1.6.1 1.6.10 1.6.11 1.6.12 All 61 releases
import-facebook-events / templates / archive-content.php

archive-content.php in Import Social Events 1.2.0, at templates/archive-content.php

55 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Template part for displaying posts
4 *
5 * @link https://codex.wordpress.org/Template_Hierarchy
6 *
7 * @package WordPress
8 * @subpackage Twenty_Seventeen
9 * @since 1.0
10 * @version 1.0
11 */
12
13 $event_date = get_post_meta( get_the_ID(), 'event_start_date', true );
14 if( $event_date != '' ){
15 $event_date = strtotime( $event_date );
16 }
17 $event_address = get_post_meta( get_the_ID(), 'venue_name', true );
18 $venue_address = get_post_meta( get_the_ID(), 'venue_address', true );
19 if( $event_address != '' && $venue_address != '' ){
20 $event_address .= ' - '.$venue_address;
21 }elseif( $venue_address != '' ){
22 $event_address = $venue_address;
23 }
24
25 $image_url = array();
26 if ( '' !== get_the_post_thumbnail() ){
27 $image_url = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' );
28 }else{
29 $image_date = date_i18n('F+d', $event_date );
30 $image_url[] = "http://placehold.it/420x150?text=".$image_date;
31 }
32
33 ?>
34 <a href="<?php echo esc_url( get_permalink() ) ?>">
35 <div class="<?php echo $css_class; ?> archive-event <?php post_class(); ?>">
36 <div class="ife_event" >
37 <div class="img_placeholder" style=" background: url('<?php echo $image_url[0]; ?>') no-repeat left top;"></div>
38 <div class="event_details">
39 <div class="event_date">
40 <span class="month"><?php echo date_i18n('M', $event_date) ; ?></span>
41 <span class="date"> <?php echo date_i18n('d', $event_date) ; ?> </span>
42 </div>
43 <div class="event_desc">
44 <a href="<?php echo esc_url( get_permalink() ) ?>" rel="bookmark">
45 <?php the_title( '<div class="event_title">','</div>' ); ?>
46 </a>
47 <?php if( $event_address != '' ){ ?>
48 <div class="event_address"><?php echo $event_address; ?></div>
49 <?php } ?>
50 </div>
51 <div style="clear: both"></div>
52 </div>
53 </div>
54 </div>
55 </a>