comments.blade.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. @if (! post_password_required())
  2. <section id="comments" class="comments">
  3. @if (have_comments())
  4. <h2>
  5. {!! /* translators: %1$s is replaced with the number of comments and %2$s with the post title */ sprintf(_nx('%1$s response to &ldquo;%2$s&rdquo;', '%1$s responses to &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'sage'), get_comments_number() === 1 ? _x('One', 'comments title', 'sage') : number_format_i18n(get_comments_number()), '<span>' . get_the_title() . '</span>') !!}
  6. </h2>
  7. <ol class="comment-list">
  8. {!! wp_list_comments(['style' => 'ol', 'short_ping' => true]) !!}
  9. </ol>
  10. @if (get_comment_pages_count() > 1 && get_option('page_comments'))
  11. <nav>
  12. <ul class="pager">
  13. @if (get_previous_comments_link())
  14. <li class="previous">
  15. {!! get_previous_comments_link(__('&larr; Older comments', 'sage')) !!}
  16. </li>
  17. @endif
  18. @if (get_next_comments_link())
  19. <li class="next">
  20. {!! get_next_comments_link(__('Newer comments &rarr;', 'sage')) !!}
  21. </li>
  22. @endif
  23. </ul>
  24. </nav>
  25. @endif
  26. @endif
  27. @if (! comments_open() && get_comments_number() != '0' && post_type_supports(get_post_type(), 'comments'))
  28. <x-alert type="warning">
  29. {!! __('Comments are closed.', 'sage') !!}
  30. </x-alert>
  31. @endif
  32. @php(comment_form())
  33. </section>
  34. @endif