content-footer.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /**
  3. * Template part for displaying the content footer.
  4. *
  5. * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  6. *
  7. * @package Pen
  8. */
  9. ob_start( 'trim' );
  10. // Hide tags for pages.
  11. if ( 'post' === get_post_type() ) {
  12. /* Translators: used between list items, there is a space after the comma */
  13. $tags_list = get_the_tag_list();
  14. if ( $tags_list ) {
  15. /* Translators: %s: The tag name. */
  16. printf(
  17. '<span class="tags-links%1$s">%2$s</span>',
  18. pen_class_lists( 'tags_display_override' ), /* phpcs:ignore */
  19. sprintf(
  20. '<span class="pen_heading_tags">%1$s</span>%2$s',
  21. esc_html__( 'Tagged', 'pen' ),
  22. $tags_list /* phpcs:ignore */
  23. )
  24. ); /* phpcs:ignore */
  25. }
  26. }
  27. if ( ! is_singular() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
  28. ?>
  29. <span class="comments-link<?php pen_class_lists( 'button_comment_display_override' ); ?>">
  30. <?php
  31. comments_popup_link(
  32. sprintf(
  33. wp_kses(
  34. /* Translators: %s: post title */
  35. __( 'Leave a Comment<span class="screen-reader-text"> on %s</span>', 'pen' ),
  36. array(
  37. 'span' => array(
  38. 'class' => array(),
  39. ),
  40. )
  41. ),
  42. get_the_title()
  43. )
  44. );
  45. echo '</span>';
  46. }
  47. if ( ! is_singular() ) {
  48. edit_post_link(
  49. sprintf(
  50. /* Translators: %s: Name of current post */
  51. esc_html__( 'Edit %s', 'pen' ),
  52. the_title( '<span class="screen-reader-text">"', '"</span>', false )
  53. ),
  54. sprintf(
  55. '<span class="edit-link%s">',
  56. pen_class_lists( 'button_edit_display_override' )
  57. ),
  58. '</span>'
  59. );
  60. }
  61. $post_footer = ob_get_clean();
  62. $social_share = pen_html_share( 'footer' );
  63. $entry_meta = pen_html_content_information( 'footer' );
  64. if ( $post_footer || $social_share || $entry_meta ) {
  65. ?>
  66. <footer class="entry-footer<?php echo pen_class_lists( 'footer_display_override' ); /* phpcs:ignore */ ?>">
  67. <div class="pen_actions">
  68. <?php
  69. echo $post_footer; /* phpcs:ignore */
  70. echo $social_share; /* phpcs:ignore */
  71. ?>
  72. </div>
  73. <?php
  74. echo $entry_meta; /* phpcs:ignore */
  75. ?>
  76. </footer><!-- .entry-footer -->
  77. <?php
  78. }