content.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * Template part for displaying posts.
  4. *
  5. * @link https://codex.wordpress.org/Template_Hierarchy
  6. *
  7. * @package TextBook
  8. */
  9. ?>
  10. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  11. <header class="entry-header">
  12. <?php
  13. if ( is_single() ) {
  14. the_title( '<h1 class="entry-title"><span>', '</span></h1>' );
  15. } else {
  16. the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
  17. }
  18. if ( 'post' === get_post_type() ) : ?>
  19. <?php get_template_part( 'components/post/content', 'meta' ); ?>
  20. <?php
  21. endif; ?>
  22. </header>
  23. <?php if ( '' != get_the_post_thumbnail() ) : ?>
  24. <div class="post-thumbnail">
  25. <a href="<?php the_permalink(); ?>">
  26. <?php the_post_thumbnail( 'full' ); ?>
  27. </a>
  28. </div>
  29. <?php endif; ?>
  30. <div class="entry-content">
  31. <?php
  32. the_content( sprintf(
  33. /* translators: %s: Name of current post. */
  34. wp_kses( __( 'Continue reading %s <span class="meta-nav">&rarr;</span>', 'textbook' ), array( 'span' => array( 'class' => array() ) ) ),
  35. the_title( '<span class="screen-reader-text">"', '"</span>', false )
  36. ) );
  37. wp_link_pages( array(
  38. 'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'textbook' ),
  39. 'after' => '</div>',
  40. ) );
  41. ?>
  42. </div>
  43. <?php get_template_part( 'components/post/content', 'footer' ); ?>
  44. </article><!-- #post-## -->