section-featured.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * The template part for displaying Featured Content via Jetpack featured-content settings
  4. *
  5. * Learn more: http://jetpack.me/support/featured-content/
  6. *
  7. * @package Rebalance
  8. */
  9. // Set Up Featured Posts
  10. $featured = rebalance_get_featured_projects();
  11. // No posts, so return
  12. if ( empty( $featured ) )
  13. return;
  14. ?>
  15. <?php foreach ( $featured as $post ) : setup_postdata( $post ); ?>
  16. <section id="feature" class="site-feature clear-fix">
  17. <?php $thumbclass = ( rebalance_has_post_thumbnail() ? 'has-thumbnail' : '' ); ?>
  18. <article id="post-<?php the_ID(); ?>" class="hentry featured-project <?php echo $thumbclass; ?>">
  19. <?php if ( rebalance_has_post_thumbnail() ) { ?>
  20. <div class="post-hero-image">
  21. <figure class="entry-image">
  22. <a href="<?php the_permalink() ?>" class="entry-image-link">
  23. <?php the_post_thumbnail( 'full' ); ?>
  24. </a>
  25. </figure>
  26. </div><!-- .post-hero-image -->
  27. <?php } ?>
  28. <header class="entry-header">
  29. <?php the_title( sprintf( '<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' ); ?>
  30. <div class="entry-summary">
  31. <?php the_excerpt(); ?>
  32. </div><!-- .entry-content -->
  33. <div class="entry-meta">
  34. <?php rebalance_entry_footer(); ?>
  35. </div><!-- .entry-meta -->
  36. </header><!-- .entry-header -->
  37. </article><!-- #post-## -->
  38. </section>
  39. <?php endforeach; ?>
  40. <?php // Reset posts so our normal loop isn't affected
  41. wp_reset_postdata(); ?>