Making WordPress.org


Ignore:
Timestamp:
01/16/2015 10:48:01 PM (10 years ago)
Author:
obenland
Message:

WP.org Themes: Improve server-side rendering of themes.

  • Takes into account all possible views.
  • Actually render markup for single themes.

See #745.

File:
1 edited

Legend:

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

    r1151 r1156  
    1212 */
    1313
    14 include ABSPATH . 'wp-admin/includes/theme.php';
    1514
    16 $args = array(
    17     'per_page' => 15,
    18     'fields'   => array_merge( $GLOBALS['theme_field_defaults'], array(
    19         'parent' => true,
    20     ) ),
    21 );
    22 
    23 if ( get_query_var( 'tag' ) ) {
    24     $args['tag'][] = get_query_var( 'tag' );
    25 }
    26 elseif ( get_query_var( 'author_name' ) ) {
    27     $args['author'] = get_query_var( 'author_name' );
    28 }
    29 else {
    30     $args['browse'] = 'featured';
    31 
    32     if ( in_array( get_query_var( 'name' ), array( 'featured', 'popular', 'new' ) ) ) {
    33         $args['browse'] = get_query_var( 'name' );
    34     }
    35 }
    36 $themes = themes_api( 'query_themes', $args );
    3715
    3816get_header();
     17
     18global $themes;
    3919?>
    4020
     
    8767                <?php
    8868                if ( ! is_wp_error( $themes ) ) :
    89                     foreach ( $themes->themes as $theme ) :
    90                         get_template_part( 'content', 'index' );
    91                     endforeach;
     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;
    9277                endif;
    9378                ?>
Note: See TracChangeset for help on using the changeset viewer.