content.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * Template part for displaying posts.
  4. *
  5. * @link https://codex.wordpress.org/Template_Hierarchy
  6. *
  7. * @package Affinity
  8. */
  9. ?>
  10. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  11. <?php if ( ! is_single() && affinity_has_post_thumbnail() ) : ?>
  12. <div class="featured-image">
  13. <a href="<?php echo esc_url( get_permalink() ); ?>" rel="bookmark">
  14. <?php the_post_thumbnail(); ?>
  15. </a>
  16. </div><!-- .featured-image -->
  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. ?>
  26. </header>
  27. <?php if ( has_excerpt() && ( is_single() || ! affinity_content_options_show_excerpt() ) ) : ?>
  28. <div class="entry-summary">
  29. <?php the_excerpt(); ?>
  30. </div>
  31. <?php endif; ?>
  32. <?php if ( 'post' === get_post_type() ) : ?>
  33. <?php get_template_part( 'components/post/content', 'meta' ); ?>
  34. <?php endif; ?>
  35. <div class="entry-content">
  36. <?php
  37. the_content( sprintf(
  38. /* translators: %s: Name of current post. */
  39. wp_kses( __( 'Continue reading %s <span class="meta-nav">&rarr;</span>', 'affinity' ), array( 'span' => array( 'class' => array() ) ) ),
  40. the_title( '<span class="screen-reader-text">"', '"</span>', false )
  41. ) );
  42. wp_link_pages( array(
  43. 'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'affinity' ),
  44. 'after' => '</div>',
  45. ) );
  46. ?>
  47. </div>
  48. <?php if ( 'post' === get_post_type() ) : ?>
  49. <?php get_template_part( 'components/post/content', 'footer' ); ?>
  50. <?php endif; ?>
  51. </article><!-- #post-## -->