Changeset 3208
- Timestamp:
- 05/20/2016 10:50:42 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/front-page.php
r3204 r3208 11 11 12 12 $sections = array( 13 ' popular ' => __( 'PopularPlugins', 'wporg-plugins' ),14 ' trending' => __( 'TrendingPlugins', 'wporg-plugins' ),13 'featured' => __( 'Featured Plugins', 'wporg-plugins' ), 14 'popular' => __( 'Popular Plugins', 'wporg-plugins' ), 15 15 'beta' => __( 'Beta Plugins', 'wporg-plugins' ), 16 16 ); … … 26 26 <main id="main" class="site-main" role="main"> 27 27 28 <?php foreach ( $sections as $section_slug => $section_title ) : ?> 28 <?php foreach ( $sections as $section_slug => $section_title ) : 29 $section_args = array( 30 'post_type' => 'plugin', 31 'posts_per_page' => 4, 32 'plugin_category' => $section_slug, 33 ); 34 35 if ( 'popular' === $section_slug ) : 36 $section_args['meta_key'] = 'active_installs'; 37 $section_args['orderby'] = 'meta_value_num'; 38 unset( $section_args['plugin_category'] ); 39 endif; 40 41 $section_query = new \WP_Query( $section_args ); 42 ?> 29 43 30 44 <section class="plugin-section"> 31 45 <header class="section-header"> 32 46 <h1 class="section-title"><?php echo esc_html( $section_title ); ?></h1> 33 <a class="section-link" href="<?php echo esc_url( home_url( $section_slug) ); ?>"><?php _ex( 'See all', 'plugins', 'wporg-plugins' ); ?></a>47 <a class="section-link" href="<?php echo esc_url( home_url( "browse/$section_slug/" ) ); ?>"><?php _ex( 'See all', 'plugins', 'wporg-plugins' ); ?></a> 34 48 </header> 35 49 36 50 <?php 37 while ( have_posts() ) :38 the_post();51 while ( $section_query->have_posts() ) : 52 $section_query->the_post(); 39 53 40 54 get_template_part( 'template-parts/plugin', 'index' );
Note: See TracChangeset
for help on using the changeset viewer.