Making WordPress.org


Ignore:
Timestamp:
02/17/2015 11:18:19 PM (9 years ago)
Author:
obenland
Message:

WP.org Themes: Use main query instead of Themes API for server output.

  • Can now deal properly with /browse/*/ URL structure.
  • Adds single theme navigation.
  • Adds Photon support for server output.
  • Brings single theme view closer to melchoyce's mockups.

See #745.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/index.php

    r1247 r1274  
    1212 */
    1313
    14 
    15 
     14if ( ! function_exists( 'get_theme_feature_list' ) ) {
     15    include ABSPATH . 'wp-admin/includes/theme.php';
     16}
    1617get_header();
    17 
    18 global $themes;
    1918?>
    2019
     
    2221        <div class="wp-filter">
    2322            <div class="filter-count">
    24                 <span class="count theme-count"><?php echo count( $themes->themes ); ?></span>
     23                <span class="count theme-count"><?php echo $GLOBALS['wp_query']->found_posts; ?></span>
    2524            </div>
    2625
     
    6665            <div class="themes" style="display:none;">
    6766                <?php
    68                 if ( ! is_wp_error( $themes ) ) :
    69                     if ( is_single() ) :
    70                         $theme = array_shift( $themes->themes );
    71                         get_template_part( 'content', 'single' );
    72                     else :
    73                         foreach ( $themes->themes as $theme ) :
    74                             get_template_part( 'content', 'index' );
    75                         endforeach;
    76                     endif;
    77                 endif;
     67                    while ( have_posts() ) :
     68                        the_post();
     69                        get_template_part( 'content', is_single() ? 'single' : 'index' );
     70                    endwhile;
     71
     72                    the_posts_navigation( array(
     73                        'prev_text' => __( 'Next', 'wporg-themes' ),
     74                        'next_text' => __( 'Previous', 'wporg-themes' ),
     75                    ) );
    7876                ?>
    7977            </div>
Note: See TracChangeset for help on using the changeset viewer.