Making WordPress.org

Changeset 1127


Ignore:
Timestamp:
01/12/2015 12:58:52 AM (12 years ago)
Author:
iandunn
Message:

Central Theme: Fix dates and locations on Past WordCamps template.

r1113 resulted in the date and location of the first camp in the array being used for all the camps, because the wcpt template functions assume that a while( have_posts() ) style of loop is being used. This page template needs to use a foreach loop because of the array structure, so we have to explicitly tell the wcpt functions which post ID to use.

Location:
sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012
Files:
2 edited

Legend:

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

    r1113 r1127  
    592592        }
    593593
    594         public static function the_wordcamp_date() {
    595                 $start_day = wcpt_get_wordcamp_start_date( 0, 'j' );
    596                 $start_month = wcpt_get_wordcamp_start_date( 0, 'F' );
    597                 $end_day = wcpt_get_wordcamp_end_date( 0, 'j' );
    598                 $end_month = wcpt_get_wordcamp_end_date( 0, 'F' );
     594        public static function the_wordcamp_date( $wordcamp_id = 0 ) {
     595                $start_day = wcpt_get_wordcamp_start_date( $wordcamp_id, 'j' );
     596                $start_month = wcpt_get_wordcamp_start_date( $wordcamp_id, 'F' );
     597                $end_day = wcpt_get_wordcamp_end_date( $wordcamp_id, 'j' );
     598                $end_month = wcpt_get_wordcamp_end_date( $wordcamp_id, 'F' );
    599599
    600600                echo "$start_month $start_day";
  • sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/template-past-wordcamps.php

    r1113 r1127  
    5656
    5757                                                                                <h2 class="wc-title"><?php wcpt_wordcamp_title(); ?></h2>
    58                                                                                 <span class="wc-country"><?php wcpt_wordcamp_location(); ?></span>
     58                                                                                <span class="wc-country"><?php wcpt_wordcamp_location( $post->ID ); ?></span>
    5959
    6060                                                                                <span class="wc-date">
    61                                                                                         <?php WordCamp_Central_Theme::the_wordcamp_date(); ?>,
    62                                                                                         <?php wcpt_wordcamp_start_date( 0, 'Y' ); ?>
     61                                                                                        <?php WordCamp_Central_Theme::the_wordcamp_date( $post->ID ); ?>,
     62                                                                                        <?php wcpt_wordcamp_start_date( $post->ID, 'Y' ); ?>
    6363                                                                                </span>
    6464                                                                        </a>
Note: See TracChangeset for help on using the changeset viewer.