PageRenderTime 87ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/themes/OneMozilla/image.php

https://github.com/fvignals/One-Mozilla-blog
PHP | 52 lines | 42 code | 10 blank | 0 comment | 2 complexity | 72245a525a846c18f9c63d0f9ee76d4a MD5 | raw file
  1. <?php get_header(); ?>
  2. <div id="content-main" class="main" role="main">
  3. <?php while ( have_posts() ) : the_post(); ?>
  4. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  5. <header class="entry-header">
  6. <h1 class="entry-title"><?php the_title(); ?></h1>
  7. <div class="entry-meta">
  8. <p class="attach-meta">
  9. <?php
  10. $metadata = wp_get_attachment_metadata();
  11. printf( __( 'Published <time class="published" title="%1$s" datetime="%1$s">%2$s</time> at <a href="%3$s" title="Link to full-size image">%4$s &times; %5$s</a>', 'onemozilla' ),
  12. esc_attr( get_the_time('Y-m-d\TH:i:sP') ),
  13. get_the_date(get_option('date_format')),
  14. esc_url( wp_get_attachment_url() ),
  15. $metadata['width'],
  16. $metadata['height']
  17. );
  18. ?>
  19. </p>
  20. <?php edit_post_link( __( 'Edit Attachment', 'onemozilla' ), '<p class="edit">', '</p>' ); ?>
  21. </div>
  22. </header>
  23. <div class="entry-content">
  24. <figure class="entry-attachment">
  25. <?php
  26. $attachment_size = apply_filters( 'onemozilla_attachment_size', 712 );
  27. echo wp_get_attachment_image( $post->ID, array( $attachment_size, 1024 ) ); // filterable image width with 1024px limit for image height.
  28. ?>
  29. <?php if ( ! empty( $post->post_excerpt ) ) : ?>
  30. <figcaption class="entry-caption">
  31. <?php the_excerpt(); ?>
  32. </figcaption>
  33. <?php endif; ?>
  34. </figure>
  35. <?php the_content(); ?>
  36. <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'onemozilla' ) . '</span>', 'after' => '</div>' ) ); ?>
  37. </div><!-- .entry-content -->
  38. </article><!-- #post -->
  39. <?php endwhile; // end of the loop. ?>
  40. </div><!-- #content-main -->
  41. <?php get_sidebar(); ?>
  42. <?php get_footer(); ?>