attachment.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php get_header(); ?>
  2. <div class="container">
  3. <article id="content" class="single" role="main">
  4. <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
  5. <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  6. <div class="entry-content">
  7. <div class="date">
  8. <time class="updated" datetime="<?php the_time('c');?>" itemprop="datePublished"><?php the_time('n/j/Y'); ?></time>
  9. </div>
  10. <span class="vcard author"><span class="fn">David A. Windham</span></span>
  11. <?php $img_url = wp_get_attachment_image_src(get_post_thumbnail_id(),'thumbnail'); ?>
  12. <img itemprop="image" src="<?php echo $img_url[0];?>" alt="thumbnail" style="display:none"/>
  13. <h2 itemprop="name headline" class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'daw' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  14. <?php if (wp_attachment_is_image($post->id)) {
  15. $att_image = wp_get_attachment_image_src( $post->id, "full");
  16. ?>
  17. <p class="attachment">
  18. <a href="<?php echo wp_get_attachment_url($post->id); ?>" title="<?php the_title(); ?>">
  19. <img src="<?php echo $att_image[0];?>" width="<?php echo $att_image[1];?>" height="<?php echo $att_image[2];?>" class="attachment-medium" alt="<?php $post->post_excerpt; ?>" />
  20. </a>
  21. </p>
  22. <?php } ?>
  23. <?php the_content(); ?>
  24. <div class="clear">&nbsp;</div>
  25. <div id="nav-below" class="navigation">
  26. <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'daw' ) . '</span> %title' ); ?></div>
  27. <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'daw' ) . '</span>' ); ?></div>
  28. </div>
  29. </div>
  30. </div>
  31. <?php endwhile; ?>
  32. </article>
  33. </div>
  34. <?php get_footer(); ?>