image.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. /**
  3. * The template for displaying image attachments.
  4. *
  5. * @package bml
  6. */
  7. get_header(); ?>
  8. <div id="primary" class="content-area image-attachment">
  9. <main id="main" class="site-main" role="main">
  10. <?php while ( have_posts() ) : the_post(); ?>
  11. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  12. <header class="entry-header">
  13. <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
  14. <div class="entry-meta">
  15. <?php
  16. $metadata = wp_get_attachment_metadata();
  17. printf( __( 'Published <span class="entry-date"><time class="entry-date" datetime="%1$s">%2$s</time></span> at <a href="%3$s">%4$s &times; %5$s</a> in <a href="%6$s" rel="gallery">%7$s</a>', 'bml' ),
  18. esc_attr( get_the_date( 'c' ) ),
  19. esc_html( get_the_date() ),
  20. esc_url( wp_get_attachment_url() ),
  21. $metadata['width'],
  22. $metadata['height'],
  23. esc_url( get_permalink( $post->post_parent ) ),
  24. get_the_title( $post->post_parent )
  25. );
  26. edit_post_link( __( 'Edit', 'bml' ), '<span class="edit-link">', '</span>' );
  27. ?>
  28. </div><!-- .entry-meta -->
  29. <nav role="navigation" id="image-navigation" class="image-navigation">
  30. <div class="nav-previous"><?php previous_image_link( false, __( '<span class="meta-nav">&larr;</span> Previous', 'bml' ) ); ?></div>
  31. <div class="nav-next"><?php next_image_link( false, __( 'Next <span class="meta-nav">&rarr;</span>', 'bml' ) ); ?></div>
  32. </nav><!-- #image-navigation -->
  33. </header><!-- .entry-header -->
  34. <div class="entry-content">
  35. <div class="entry-attachment">
  36. <div class="attachment">
  37. <?php bml_the_attached_image(); ?>
  38. </div><!-- .attachment -->
  39. <?php if ( has_excerpt() ) : ?>
  40. <div class="entry-caption">
  41. <?php the_excerpt(); ?>
  42. </div><!-- .entry-caption -->
  43. <?php endif; ?>
  44. </div><!-- .entry-attachment -->
  45. <?php
  46. the_content();
  47. wp_link_pages( array(
  48. 'before' => '<div class="page-links">' . __( 'Pages:', 'bml' ),
  49. 'after' => '</div>',
  50. ) );
  51. ?>
  52. </div><!-- .entry-content -->
  53. <?php edit_post_link( __( 'Edit', 'bml' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' ); ?>
  54. </article><!-- #post-## -->
  55. <?php
  56. // If comments are open or we have at least one comment, load up the comment template
  57. if ( comments_open() || '0' != get_comments_number() )
  58. comments_template();
  59. ?>
  60. <?php endwhile; // end of the loop. ?>
  61. </main><!-- #main -->
  62. </div><!-- #primary -->
  63. <?php get_footer(); ?>