content-featured-full.php 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * The template for displaying featured content on the front page in full width
  4. *
  5. * @package TextBook
  6. */
  7. ?>
  8. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  9. <?php if ( 'post' === get_post_type() ) : ?>
  10. <?php get_template_part( 'components/post/content', 'meta' ); ?>
  11. <?php else : ?>
  12. <div class="entry-meta">
  13. <span class="featured-page-meta"><?php esc_html_e( 'Featured', 'textbook' ); ?></span>
  14. </div>
  15. <?php endif; ?>
  16. <?php if ( '' != get_the_post_thumbnail() ) : ?>
  17. <figure class="post-thumbnail">
  18. <a href="<?php the_permalink(); ?>">
  19. <?php the_post_thumbnail( 'textbook-featured-content-image-full' ); ?>
  20. </a>
  21. </figure>
  22. <?php endif; ?>
  23. <?php the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); ?>
  24. <div class="entry-content entry-summary">
  25. <?php
  26. $content = get_the_content();
  27. $content = strip_shortcodes( $content );
  28. $content = wp_trim_words( $content, '20' );
  29. echo apply_filters( 'the_content', $content );?>
  30. </div>
  31. </article>