content-featured.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php if( of_get_option( 'foto_show_featured' ) ) : ?>
  2. <section id="featured" class="site-featured-content clearfix">
  3. <?php
  4. $sticky = get_option( 'sticky_posts' );
  5. if ( ! empty( $sticky ) ) : ?>
  6. <div class="featured-slider col-18">
  7. <div class="rslides-container">
  8. <ul class="rslides">
  9. <?php
  10. global $post;
  11. $args = array(
  12. 'post__in' => $sticky
  13. );
  14. $slides = get_posts( $args ); ?>
  15. <?php foreach( $slides as $post ) : setup_postdata( $post ); ?>
  16. <li>
  17. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  18. <?php if( has_post_thumbnail() ) : ?>
  19. <figure class="entry-image">
  20. <a href="<?php the_permalink() ?>">
  21. <?php the_post_thumbnail('foto-featured', array( 'class' => 'photo thumbnail', 'alt' => get_the_title(), 'title' => get_the_title()));?>
  22. </a>
  23. </figure>
  24. <?php endif; ?>
  25. <h2 class="entry-title"><?php the_title(); ?></h2>
  26. </article><!-- end #post-<?php the_ID(); ?> -->
  27. </li>
  28. <?php endforeach; wp_reset_postdata(); ?>
  29. </ul><!-- end .rslides -->
  30. </div><!-- end .rslides-container -->
  31. </div><!-- end .featured-slider -->
  32. <?php endif; ?>
  33. <aside class="featured-sidebar col-6 last">
  34. <?php do_action( 'before_home_sidebar' ); ?>
  35. <?php if ( ! dynamic_sidebar( 'Home Widget' ) ) : ?>
  36. <?php endif; ?>
  37. </aside><!-- end .featured-sidebar -->
  38. </section><!-- end #featured .site-featured-content -->
  39. <?php endif; ?>