content.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /**
  3. * Template part for displaying posts.
  4. *
  5. * @link https://codex.wordpress.org/Template_Hierarchy
  6. *
  7. * @package Dara
  8. */
  9. ?>
  10. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  11. <?php if ( dara_has_post_thumbnail() ) : ?>
  12. <div class="post-thumbnail">
  13. <a href="<?php the_permalink(); ?>">
  14. <?php the_post_thumbnail( 'dara-featured-image' ); ?>
  15. </a>
  16. </div>
  17. <?php endif; ?>
  18. <header class="entry-header">
  19. <?php
  20. // Hide category and tag text for pages.
  21. if ( 'post' === get_post_type() ) {
  22. /* translators: used between list items, there is a space after the comma */
  23. $categories_list = get_the_category_list( ', ' );
  24. if ( $categories_list && dara_categorized_blog() ) {
  25. printf( '<span class="cat-links">%1$s</span>', $categories_list );
  26. }
  27. }
  28. if ( is_single() ) {
  29. the_title( '<h1 class="entry-title">', '</h1>' );
  30. } else {
  31. the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
  32. } ?>
  33. </header>
  34. <div class="entry-body">
  35. <?php if ( 'post' === get_post_type() ) : ?>
  36. <?php get_template_part( 'components/post/content', 'meta' ); ?>
  37. <?php endif; ?>
  38. <div class="entry-content">
  39. <?php
  40. the_content( sprintf(
  41. /* translators: %s: Name of current post. */
  42. wp_kses( __( 'Continue reading %s <span class="meta-nav">&rarr;</span>', 'dara' ), array( 'span' => array( 'class' => array() ) ) ),
  43. the_title( '<span class="screen-reader-text">"', '"</span>', false )
  44. ) );
  45. wp_link_pages( array(
  46. 'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'dara' ),
  47. 'after' => '</div>',
  48. ) );
  49. ?>
  50. </div>
  51. <?php get_template_part( 'components/post/content', 'footer' ); ?>
  52. <?php dara_author_bio(); ?>
  53. </div><!-- .entry-body -->
  54. </article><!-- #post-## -->