Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Get the page as an Object
- $featured_args = array(
- 'posts_per_page' => 1,
- 'post__in' => get_option( 'sticky_posts' ),
- 'public' => true,
- 'ignore_sticky_posts' => 1,
- 'post_type' => 'post'
- );
- // The Featured Posts query.
- $featured = new WP_Query( $featured_args );
- // Proceed only if published posts exist
- if ( $featured->have_posts() ) :
- ?>
- <section id="featured-posts">
- <h2 class="featured-heading"><?php _e( 'Destacado', 'lonchpress' ); ?></h2>
- <?php
- // Let's roll.
- while ( $featured->have_posts() ) : $featured->the_post();
- /**
- * We're going to add a class to our featured post for featured images
- * by default it'll have the feature-text class.
- */
- $feature_class = 'feature-text';
- ?>
- <div class="row <?php echo $feature_class; ?>">
- <?php get_template_part( 'content', 'featured' ); ?>
- </div>
- <?php endwhile; ?>
- </section><!-- .featured-posts -->
- <?php endif; // End check for sticky posts. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement