Making WordPress.org


Ignore:
Timestamp:
01/09/2015 01:47:26 AM (11 years ago)
Author:
iandunn
Message:

Central Theme: Group wordcamps on the Past WordCamps template by year.

File:
1 edited

Legend:

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

    r1110 r1113  
    3535                                'compare'    => '<'
    3636                            ) )
    37                         ) ) 
     37                        ) )
    3838                    ) :
     39                        global $wcpt_template;
     40                        $wordcamps = WordCamp_Central_Theme::group_wordcamps_by_year( $wcpt_template->posts );
    3941                    ?>
    4042
    41                     <ul class="wc-schedule-list">
    42                     <?php while ( wcpt_wordcamps() ) : wcpt_the_wordcamp(); ?>
    43                        
    44                         <li>
    45                             <a href="<?php echo esc_url( wcpt_get_wordcamp_url() ); ?>">
    46                                 <?php if ( has_post_thumbnail() ) : ?>
    47                                     <?php the_post_thumbnail( 'wccentral-thumbnail-past', array( 'class' => 'wc-image' ) ); ?>
    48                                 <?php else : ?>
    49                                     <div class="wc-image wp-post-image past-wordcamp-placeholder-thumb" title="<?php the_title(); ?>"></div>
    50                                 <?php endif; ?>
    51                                
    52                                
    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                                
    57                                 <?php WordCamp_Central_Theme::the_wordcamp_date(); ?>,
    58                                 <?php wcpt_wordcamp_start_date( 0, 'Y' ); ?>
    59                                    
    60                                 </span>
    61                             </a>
    62                         </li>
     43                    <?php foreach ( $wordcamps as $year => $posts ) : ?>
     44                        <h3 class="wc-schedule-year"><?php echo esc_html( $year ); ?></h3>
    6345
    64                     <?php endwhile; // wcpt_wordcamps ?>
    65                 </ul>
     46                        <ul class="wc-schedule-list">
     47                            <?php foreach ( $posts as $post ) : setup_postdata( $post ); ?>
     48
     49                                <li>
     50                                    <a href="<?php echo esc_url( wcpt_get_wordcamp_url() ); ?>">
     51                                        <?php if ( has_post_thumbnail() ) : ?>
     52                                            <?php the_post_thumbnail( 'wccentral-thumbnail-past', array( 'class' => 'wc-image' ) ); ?>
     53                                        <?php else : ?>
     54                                            <div class="wc-image wp-post-image past-wordcamp-placeholder-thumb" title="<?php the_title(); ?>"></div>
     55                                        <?php endif; ?>
     56
     57                                        <h2 class="wc-title"><?php wcpt_wordcamp_title(); ?></h2>
     58                                        <span class="wc-country"><?php wcpt_wordcamp_location(); ?></span>
     59
     60                                        <span class="wc-date">
     61                                            <?php WordCamp_Central_Theme::the_wordcamp_date(); ?>,
     62                                            <?php wcpt_wordcamp_start_date( 0, 'Y' ); ?>
     63                                        </span>
     64                                    </a>
     65                                </li>
     66
     67                            <?php endforeach; ?>
     68                        </ul>
     69                    <?php wp_reset_postdata(); endforeach; ?>
     70
    6671                <a href="<?php echo home_url( '/schedule/' ); ?>" class="wc-schedule-more"><span class="arrow">&larr;</span> Upcoming WordCamps</a>
    6772
Note: See TracChangeset for help on using the changeset viewer.