content.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * Template part for displaying posts.
  4. *
  5. * @link https://codex.wordpress.org/Template_Hierarchy
  6. *
  7. * @package Toujours
  8. */
  9. ?>
  10. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  11. <?php if ( has_post_thumbnail() ) { ?>
  12. <div class="featured-image">
  13. <span>
  14. <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'toujours-featured' ); ?></a>
  15. </span>
  16. </div>
  17. <?php } ?>
  18. <header class="entry-header">
  19. <?php if ( is_sticky() && is_home() ) { ?>
  20. <span class="featured-post"><?php esc_html_e( 'Featured', 'toujours' ); ?></span>
  21. <?php } ?>
  22. <?php if (! is_single() ) {
  23. the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
  24. } else {
  25. the_title( '<h2 class="entry-title">', '</h2>' );
  26. } ?>
  27. <?php if ( 'post' === get_post_type() ) : ?>
  28. <div class="entry-meta">
  29. <?php
  30. toujours_posted_on();
  31. toujours_comment_link();
  32. ?>
  33. </div><!-- .entry-meta -->
  34. <?php endif; ?>
  35. </header><!-- .entry-header -->
  36. <?php if ( '' !== $post->post_content ) { ?>
  37. <div class="entry-content">
  38. <?php
  39. the_content( sprintf(
  40. /* translators: %s: Name of current post. */
  41. wp_kses( __( 'Continue reading %s <span class="meta-nav">&rarr;</span>', 'toujours' ), array( 'span' => array( 'class' => array() ) ) ),
  42. the_title( '<span class="screen-reader-text">"', '"</span>', false )
  43. ) );
  44. ?>
  45. <?php
  46. wp_link_pages( array(
  47. 'before' => '<div class="page-links"><span class="page-links-title">' . esc_html__( 'Pages:', 'toujours' ) . '</span>',
  48. 'after' => '</div>',
  49. 'pagelink' => '<span class="page-links-num">%</span>'
  50. ) );
  51. ?>
  52. </div><!-- .entry-content -->
  53. <?php } ?>
  54. <footer class="entry-footer">
  55. <?php toujours_entry_footer(); ?>
  56. </footer><!-- .entry-footer -->
  57. </article><!-- #post-## -->