Changeset 5530
- Timestamp:
- 05/31/2017 10:18:31 PM (8 years ago)
- Location:
- sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/functions.php
r4781 r5530 718 718 } 719 719 720 public static function the_wordcamp_date( $wordcamp_id = 0 ) { 720 /** 721 * Output the date or date range of a WordCamp event. 722 * 723 * @param int $wordcamp_id The ID of the WordCamp post. 724 * @param bool $show_year Optional. True to include the year in the date output. 725 */ 726 public static function the_wordcamp_date( $wordcamp_id = 0, $show_year = false ) { 721 727 $start_day = wcpt_get_wordcamp_start_date( $wordcamp_id, 'j' ); 722 728 $start_month = wcpt_get_wordcamp_start_date( $wordcamp_id, 'F' ); … … 724 730 $end_month = wcpt_get_wordcamp_end_date( $wordcamp_id, 'F' ); 725 731 732 if ( $show_year ) { 733 $start_year = wcpt_get_wordcamp_start_date( $wordcamp_id, 'Y' ); 734 $end_year = wcpt_get_wordcamp_end_date( $wordcamp_id, 'Y' ); 735 } 736 726 737 echo "$start_month $start_day"; 738 727 739 if ( $end_day ) { 728 echo '-'; 729 if ( $start_month != $end_month ) 740 if ( $show_year && $start_year !== $end_year ) { 741 echo ", $start_year"; 742 } 743 744 echo '–'; 745 746 if ( $start_month !== $end_month ) { 730 747 echo "$end_month "; 748 } 731 749 732 750 echo $end_day; 751 752 if ( $show_year ) { 753 echo ", $end_year"; 754 } 755 } elseif ( $show_year ) { 756 echo ", $start_year"; 733 757 } 734 758 } -
sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/template-past-wordcamps.php
r4038 r5530 65 65 66 66 <span class="wc-date"> 67 <?php WordCamp_Central_Theme::the_wordcamp_date( $post->ID ); ?>, 68 <?php wcpt_wordcamp_start_date( $post->ID, 'Y' ); ?> 67 <?php WordCamp_Central_Theme::the_wordcamp_date( $post->ID, true ); ?> 69 68 </span> 70 69 </a> -
sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/template-schedule.php
r5165 r5530 38 38 ) ) 39 39 ) : 40 global $wcpt_template; 41 $wordcamps = WordCamp_Central_Theme::group_wordcamps_by_year( $wcpt_template->posts ); 40 42 ?> 41 43 42 < ul class="wc-schedule-list">43 <?php while ( wcpt_wordcamps() ) : wcpt_the_wordcamp(); ?>44 <?php foreach ( $wordcamps as $year => $posts ) : ?> 45 <h3 class="wc-schedule-year"><?php echo esc_html( $year ); ?></h3> 44 46 45 <li> 46 <a href="<?php echo esc_url( wcpt_get_wordcamp_url() ); ?>"> 47 <?php if ( has_post_thumbnail() ) : ?> 48 <?php the_post_thumbnail( 'wccentral-thumbnail-small', array( 'class' => 'wc-image' ) ); ?> 49 <?php else : ?> 50 <div class="wc-image wp-post-image wordcamp-placeholder-thumb" title="<?php the_title(); ?>"></div> 51 <?php endif; ?> 47 <ul class="wc-schedule-list"> 48 <?php foreach ( $posts as $post ) : setup_postdata( $post ); ?> 52 49 53 < h2 class="wc-title"><?php wcpt_wordcamp_title(); ?></h2>54 <span class="wc-country"><?php wcpt_wordcamp_location(); ?></span>55 <span class="wc-date">56 <?php WordCamp_Central_Theme::the_wordcamp_date(); ?>57 </span>58 </a>59 </li>50 <li> 51 <a href="<?php echo esc_url( WordCamp_Central_Theme::get_best_wordcamp_url( $post->ID ) ); ?>"> 52 <?php if ( has_post_thumbnail() ) : ?> 53 <?php the_post_thumbnail( 'wccentral-thumbnail-small', array( 'class' => 'wc-image' ) ); ?> 54 <?php else : ?> 55 <div class="wc-image wp-post-image wordcamp-placeholder-thumb" title="<?php the_title(); ?>"></div> 56 <?php endif; ?> 60 57 61 <?php endwhile; // wcpt_wordcamps ?> 62 </ul> 58 <h2 class="wc-title"><?php wcpt_wordcamp_title(); ?></h2> 59 <span class="wc-country"><?php wcpt_wordcamp_location( $post->ID ); ?></span> 60 61 <span class="wc-date"> 62 <?php WordCamp_Central_Theme::the_wordcamp_date( $post->ID, true ); ?> 63 </span> 64 </a> 65 </li> 66 67 <?php endforeach; // $posts as post ?> 68 </ul> 69 <?php wp_reset_postdata(); endforeach; ?> 70 63 71 <a href="<?php echo home_url( '/schedule/past-wordcamps/' ); ?>" class="wc-schedule-more">Past WordCamps →</a> 64 72
Note: See TracChangeset
for help on using the changeset viewer.