WordPress.org

Making WordPress.org


Ignore:
Timestamp:
09/06/2017 10:13:34 PM (2 years ago)
Author:
obenland
Message:

WPorg/Main: First pass at blog-related templates.

See #2861.

File:
1 edited

Legend:

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

    r5891 r5892  
    115115
    116116                <?php
    117                 foreach ( get_posts( [ 'numberposts' => 1 ] ) as $featured_post ) :
    118                     setup_postdata( $featured_post );
     117                $featured = new \WP_Query( [ 'posts_per_page' => 1 ] );
     118                while ( $featured->have_posts() ) :
     119                    $featured->the_post();
    119120                    the_title( sprintf( '<h5><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h5>' );
    120121                    echo '<p>' . apply_filters( 'the_excerpt', get_the_excerpt() ) . '</p>';
    121                 endforeach;
    122                 wp_reset_postdata();
     122                endwhile;
     123                wp_reset_query();
    123124                ?>
    124125            </div>
Note: See TracChangeset for help on using the changeset viewer.