content.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * Template part for displaying posts.
  4. *
  5. * @link https://codex.wordpress.org/Template_Hierarchy
  6. *
  7. * @package Karuna
  8. */
  9. ?>
  10. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  11. <?php if ( karuna_has_post_thumbnail() && ! ( is_single() || is_page() ) ) : ?>
  12. <div class="post-thumbnail">
  13. <a href="<?php the_permalink(); ?>">
  14. <?php the_post_thumbnail( 'karuna-featured-image' ); ?>
  15. </a>
  16. </div>
  17. <?php endif; ?>
  18. <header class="entry-header">
  19. <?php
  20. if ( is_single() ) {
  21. the_title( '<h1 class="entry-title">', '</h1>' );
  22. } else {
  23. the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
  24. }
  25. if ( 'post' === get_post_type() ) : ?>
  26. <?php get_template_part( 'components/post/content', 'meta' ); ?>
  27. <?php
  28. endif; ?>
  29. </header>
  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>', 'karuna' ), 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:', 'karuna' ),
  39. 'after' => '</div>',
  40. ) );
  41. ?>
  42. </div>
  43. <?php get_template_part( 'components/post/content', 'footer' ); ?>
  44. <?php karuna_author_bio(); ?>
  45. </article><!-- #post-## -->