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/content.php

    r1265 r1274  
    11<?php
    2     global $theme;
    3     $theme = wporg_themes_photon_screen_shot( $theme );
     2$post  = get_post();
     3$theme = new WPORG_Themes_Repo_Package( $post );
    44?>
    5 <article id="post-<?php echo $theme->slug; ?>" class="theme hentry">
    6     <a class="url" href="<?php echo esc_url( home_url( $theme->slug . '/' ) ); ?>" rel="bookmark" tabindex="-1">
     5<article id="post-<?php echo $post->post_name; ?>" class="theme hentry">
     6    <a class="url" href="<?php the_permalink(); ?>" rel="bookmark">
    77        <div class="theme-screenshot">
    8             <img src="<?php echo esc_url( $theme->screenshot_url . '?w=572&strip=all' ); ?>" alt="">
     8            <?php the_post_thumbnail( '572' ); ?>
    99        </div>
    1010        <span class="more-details"><?php _ex( 'More Info', 'theme' ); ?></span>
    11         <div class="theme-author"><?php printf( __( 'By %s' ), '<span class="author">' . $theme->author . '</span>' ); ?></div>
    12         <h3 class="theme-name entry-title"><?php echo $theme->name; ?></h3>
     11        <div class="theme-author">
     12            <?php printf( _x( 'By %s', 'post author', 'wporg-themes' ), '<span class="author vcard">' . esc_html( get_the_author() ) . '</span>' ); ?>
     13        </div>
     14        <h3 class="theme-name entry-title"><?php the_title(); ?></h3>
    1315
    1416        <div class="theme-actions">
    15             <a class="button button-primary preview install-theme-preview" href="<?php echo esc_url( '//downloads.wordpress.org/theme/' . $theme->slug . '.' . $theme->version . '.zip' ); ?>"><?php esc_html_e( 'Download' ); ?></a>
     17            <a class="button button-primary preview install-theme-preview" href="<?php echo esc_url( '//downloads.wordpress.org/theme/' . $post->post_name . '.' . $theme->latest_version() . '.zip' ); ?>"><?php esc_html_e( 'Download' ); ?></a>
    1618        </div>
    1719    </a>
Note: See TracChangeset for help on using the changeset viewer.