Bez popisu

content.php 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 ( post_type_supports( get_post_type( get_the_ID() ), 'author' ) && 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 -->