Making WordPress.org


Ignore:
Timestamp:
05/31/2017 10:18:31 PM (8 years ago)
Author:
coreymckrill
Message:

WordCamp Central: Add year to camp dates on the schedule

Changes the Schedule page template to emulate the organization on the
Past Camps page template, by grouping camps under a year header and
including the year in each camp's date.

This also adds a param to WordCamp_Central_Theme::the_wordcamp_date to
include the year in the camp date output. The default is to not include
it, for backcompat.

Props frq
Fixes #2065

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/template-schedule.php

    r5165 r5530  
    3838                        ) )
    3939                    ) :
     40                        global $wcpt_template;
     41                        $wordcamps = WordCamp_Central_Theme::group_wordcamps_by_year( $wcpt_template->posts );
    4042                    ?>
    4143
    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>
    4446
    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 ); ?>
    5249
    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; ?>
    6057
    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
    6371                <a href="<?php echo home_url( '/schedule/past-wordcamps/' ); ?>" class="wc-schedule-more">Past WordCamps &rarr;</a>
    6472
Note: See TracChangeset for help on using the changeset viewer.