content-attachment.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Template part for displaying attachment content in attachment.php.
  4. *
  5. * @link https://codex.wordpress.org/Template_Hierarchy
  6. *
  7. * @package Shoreditch
  8. */
  9. ?>
  10. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  11. <div class="hentry-wrapper">
  12. <?php the_title( '<header class="entry-header"><div class="entry-header-wrapper"><h1 class="entry-title">', '</h1></div></header>' ); ?>
  13. <div class="entry-content">
  14. <?php
  15. // Use a the large image size
  16. $image_size = apply_filters( 'shoreditch_attachment_size', 'large' );
  17. if ( wp_get_attachment_image( get_the_ID() ) ) {
  18. echo '<p>' . wp_get_attachment_image( get_the_ID(), $image_size ) . '</p>';
  19. }
  20. ?>
  21. <?php
  22. if ( has_excerpt() ) {
  23. the_excerpt();
  24. }
  25. ?>
  26. <?php the_content(); ?>
  27. </div><!-- .entry-content -->
  28. <?php
  29. edit_post_link(
  30. sprintf(
  31. /* translators: %s: Name of current post */
  32. esc_html__( 'Edit %s', 'shoreditch' ),
  33. the_title( '<span class="screen-reader-text">"', '"</span>', false )
  34. ),
  35. '<footer class="entry-footer"><span class="edit-link">',
  36. '</span></footer><!-- .entry-footer -->'
  37. );
  38. ?>
  39. </div><!-- .hentry-wrapper -->
  40. </article><!-- #post-## -->