content-featured.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * @package Sara
  4. */
  5. $featured = dara_get_featured_posts();
  6. if ( empty( $featured ) )
  7. return;
  8. ?>
  9. <div id="featured-content" class="flexslider hero">
  10. <div class="flex-viewport-wrapper hero-content">
  11. <div class="featured-posts slides" id="featured-slides">
  12. <?php
  13. foreach ( $featured as $post ) :
  14. setup_postdata( $post ); ?>
  15. <div class="hero-content-wrapper">
  16. <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
  17. <?php if ( dara_has_post_thumbnail() ) { ?>
  18. <?php the_post_thumbnail( 'dara-hero-thumbnail' ); ?>
  19. <?php } else { ?>
  20. <div class="thumbnail-placeholder"></div>
  21. <?php } ?>
  22. </a>
  23. <div class="featured-post">
  24. <?php
  25. if ( 'post' === get_post_type() ) {
  26. $categories_list = get_the_category_list( ' ' );
  27. if ( $categories_list && dara_categorized_blog() ) {
  28. printf( '<span class="cat-links">%1$s</span>', $categories_list );
  29. }
  30. } ?>
  31. <?php if ( '' !== get_the_title( $post->ID ) ) : ?>
  32. <a href="<?php the_permalink(); ?>"><?php the_title( '<h2 class="entry-title">', '</h2>' ); ?></a>
  33. <?php endif; ?>
  34. <?php get_template_part( 'components/post/content', 'meta' ); ?>
  35. </div><!-- .featured-post -->
  36. </div>
  37. <?php
  38. endforeach;
  39. wp_reset_postdata(); ?>
  40. </div><!-- .slides -->
  41. </div><!-- .hero-content -->
  42. </div><!-- .hero -->