content.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /**
  3. * The default template for displaying content
  4. *
  5. * Used for both singular and index.
  6. *
  7. * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  8. *
  9. * @package WordPress
  10. * @subpackage Twenty_Twenty
  11. * @since Twenty Twenty 1.0
  12. */
  13. ?>
  14. <article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
  15. <?php
  16. get_template_part( 'template-parts/entry-header' );
  17. if ( ! is_search() ) {
  18. get_template_part( 'template-parts/featured-image' );
  19. }
  20. ?>
  21. <div class="post-inner <?php echo is_page_template( 'templates/template-full-width.php' ) ? '' : 'thin'; ?> ">
  22. <div class="entry-content">
  23. <?php
  24. if ( is_search() || ! is_singular() && 'summary' === get_theme_mod( 'blog_content', 'full' ) ) {
  25. the_excerpt();
  26. } else {
  27. the_content( __( 'Continue reading', 'twentytwenty' ) );
  28. }
  29. ?>
  30. </div><!-- .entry-content -->
  31. </div><!-- .post-inner -->
  32. <div class="section-inner">
  33. <?php
  34. wp_link_pages(
  35. array(
  36. 'before' => '<nav class="post-nav-links bg-light-background" aria-label="' . esc_attr__( 'Page', 'twentytwenty' ) . '"><span class="label">' . __( 'Pages:', 'twentytwenty' ) . '</span>',
  37. 'after' => '</nav>',
  38. 'link_before' => '<span class="page-number">',
  39. 'link_after' => '</span>',
  40. )
  41. );
  42. edit_post_link();
  43. // Single bottom post meta.
  44. twentytwenty_the_post_meta( get_the_ID(), 'single-bottom' );
  45. if ( is_single() ) {
  46. get_template_part( 'template-parts/entry-author-bio' );
  47. }
  48. ?>
  49. </div><!-- .section-inner -->
  50. <?php
  51. if ( is_single() ) {
  52. get_template_part( 'template-parts/navigation' );
  53. }
  54. /**
  55. * Output comments wrapper if it's a post, or if comments are open,
  56. * or if there's a comment number – and check for password.
  57. * */
  58. if ( ( is_single() || is_page() ) && ( comments_open() || get_comments_number() ) && ! post_password_required() ) {
  59. ?>
  60. <div class="comments-wrapper section-inner">
  61. <?php comments_template(); ?>
  62. </div><!-- .comments-wrapper -->
  63. <?php
  64. }
  65. ?>
  66. </article><!-- .post -->