image.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. /**
  3. * The template for displaying all single posts and attachments.
  4. *
  5. * @package WordPress
  6. * @subpackage Twenty_Fifteen
  7. * @since Twenty Fifteen 1.0
  8. */
  9. get_header(); ?>
  10. <div id="primary" class="content-area">
  11. <main id="main" class="site-main" role="main">
  12. <?php while ( have_posts() ) : the_post(); ?>
  13. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  14. <nav id="image-navigation" class="navigation image-navigation">
  15. <div class="nav-links">
  16. <div class="nav-previous"><?php previous_image_link( false, esc_html__( 'Previous Image', 'twentyfifteen' ) ); ?></div><div class="nav-next"><?php next_image_link( false, esc_html__( 'Next Image', 'twentyfifteen' ) ); ?></div>
  17. </div><!-- .nav-links -->
  18. </nav><!-- .image-navigation -->
  19. <header class="entry-header">
  20. <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
  21. </header><!-- .entry-header -->
  22. <div class="entry-content">
  23. <?php
  24. /**
  25. * Filter the default Twenty Fifteen image attachment size.
  26. *
  27. * @since Twenty Fifteen 1.0
  28. *
  29. * @param string $image_size Image size. Default 'large'.
  30. */
  31. $image_size = apply_filters( 'twentyfifteen_attachment_size', 'large' );
  32. echo wp_get_attachment_image( get_the_ID(), $image_size );
  33. the_content();
  34. ?>
  35. <?php if ( has_excerpt() ) : ?>
  36. <div class="entry-caption">
  37. <?php the_excerpt(); ?>
  38. </div><!-- .entry-caption -->
  39. <?php endif; ?>
  40. <?php
  41. wp_link_pages( array(
  42. 'before' => '<div class="page-links"><span class="page-links-title">' . esc_html__( 'Pages:', 'twentyfifteen' ) . '</span>',
  43. 'after' => '</div>',
  44. 'link_before' => '<span>',
  45. 'link_after' => '</span>',
  46. ) );
  47. ?>
  48. </div><!-- .entry-content -->
  49. <footer class="entry-footer">
  50. <?php twentyfifteen_entry_meta(); ?>
  51. <?php edit_post_link( esc_html__( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?>
  52. </footer><!-- .entry-footer -->
  53. </article><!-- #post-## -->
  54. <?php
  55. // If comments are open or we have at least one comment, load up the comment template
  56. if ( comments_open() || get_comments_number() ) :
  57. comments_template();
  58. endif;
  59. ?>
  60. <?php twentyfifteen_post_nav(); ?>
  61. <?php endwhile; // end of the loop. ?>
  62. </main><!-- .site-main -->
  63. </div><!-- .content-area -->
  64. <?php get_footer(); ?>