image.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php get_header();?>
  2. <div id="press-wrap">
  3. <div class="container">
  4. <div class="row journal">
  5. <div class="twelvecol">
  6. <?php while ( have_posts() ) : the_post(); ?>
  7. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  8. <header class="entry-header">
  9. <h1 class="entry-title"><?php the_title(); ?></h1>
  10. <div class="entry-meta">
  11. <?php
  12. $metadata = wp_get_attachment_metadata();
  13. printf( __( 'Published <span class="entry-date"><time class="entry-date" datetime="%1$s" pubdate>%2$s</time></span> at <a href="%3$s" title="Link to full-size image">%4$s &times; %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%7$s</a>', '_ph' ),
  14. esc_attr( get_the_date( 'c' ) ),
  15. esc_html( get_the_date() ),
  16. wp_get_attachment_url(),
  17. $metadata['width'],
  18. $metadata['height'],
  19. get_permalink( $post->post_parent ),
  20. get_the_title( $post->post_parent )
  21. );
  22. ?>
  23. <?php edit_post_link( __( 'Edit', '_ph' ), '<span class="sep">|</span> <span class="edit-link">', '</span>' ); ?>
  24. </div>
  25. <nav id="image-navigation">
  26. <span class="previous-image"><?php previous_image_link( false, __( '&larr; Previous', '_s' ) ); ?></span>
  27. <span class="next-image"><?php next_image_link( false, __( 'Next &rarr;', '_s' ) ); ?></span>
  28. </nav>
  29. </header>
  30. <div class="entry-content">
  31. <div class="entry-attachment">
  32. <div class="attachment">
  33. <?php
  34. $attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) );
  35. foreach ( $attachments as $k => $attachment ) {
  36. if ( $attachment->ID == $post->ID )
  37. break;
  38. }
  39. $k++;
  40. if ( count( $attachments ) > 1 ) {
  41. if ( isset( $attachments[ $k ] ) )
  42. $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
  43. else
  44. $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID );
  45. } else {
  46. $next_attachment_url = wp_get_attachment_url();
  47. }
  48. ?>
  49. <a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php
  50. $attachment_size = apply_filters( '_s_attachment_size', 1200 );
  51. echo wp_get_attachment_image( $post->ID, array( $attachment_size, $attachment_size ) );
  52. ?></a>
  53. </div>
  54. <?php if ( ! empty( $post->post_excerpt ) ) : ?>
  55. <div class="entry-caption">
  56. <?php the_excerpt(); ?>
  57. </div>
  58. <?php endif; ?>
  59. </div>
  60. <?php the_content(); ?>
  61. <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', '_s' ), 'after' => '</div>' ) ); ?>
  62. </div>
  63. <footer class="entry-meta">
  64. <?php if ( comments_open() && pings_open() ) : // Comments and trackbacks open ?>
  65. <?php printf( __( '<a class="comment-link" href="#respond" title="Post a comment">Post a comment</a> or leave a trackback: <a class="trackback-link" href="%s" title="Trackback URL for your post" rel="trackback">Trackback URL</a>.', '_s' ), get_trackback_url() ); ?>
  66. <?php elseif ( ! comments_open() && pings_open() ) : // Only trackbacks open ?>
  67. <?php printf( __( 'Comments are closed, but you can leave a trackback: <a class="trackback-link" href="%s" title="Trackback URL for your post" rel="trackback">Trackback URL</a>.', '_s' ), get_trackback_url() ); ?>
  68. <?php elseif ( comments_open() && ! pings_open() ) : // Only comments open ?>
  69. <?php _e( 'Trackbacks are closed, but you can <a class="comment-link" href="#respond" title="Post a comment">post a comment</a>.', '_s' ); ?>
  70. <?php elseif ( ! comments_open() && ! pings_open() ) : // Comments and trackbacks closed ?>
  71. <?php _e( 'Both comments and trackbacks are currently closed.', '_s' ); ?>
  72. <?php endif; ?>
  73. <?php edit_post_link( __( 'Edit', '_s' ), ' <span class="edit-link">', '</span>' ); ?>
  74. </footer>
  75. </article>
  76. <?php comments_template(); ?>
  77. <?php endwhile; ?>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. <?php get_footer(); ?>