The Twenty Twelve for WordPress.
props drewstrojny, lancewillett.
also props corvannoorloos, jeffsebring, kobenland, iandstewart, mfields,
mtdesign, op12no2, philiparthurmoore, sixhours, mamaduka.
see #19978.
git-svn-id: http://core.svn.wordpress.org/trunk@21261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-12 00:20:46 -04:00
|
|
|
<?php
|
|
|
|
/**
|
2013-09-20 15:24:09 -04:00
|
|
|
* The template for displaying image attachments
|
The Twenty Twelve for WordPress.
props drewstrojny, lancewillett.
also props corvannoorloos, jeffsebring, kobenland, iandstewart, mfields,
mtdesign, op12no2, philiparthurmoore, sixhours, mamaduka.
see #19978.
git-svn-id: http://core.svn.wordpress.org/trunk@21261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-12 00:20:46 -04:00
|
|
|
*
|
2019-01-09 00:09:51 -05:00
|
|
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
2012-09-27 03:01:16 -04:00
|
|
|
*
|
The Twenty Twelve for WordPress.
props drewstrojny, lancewillett.
also props corvannoorloos, jeffsebring, kobenland, iandstewart, mfields,
mtdesign, op12no2, philiparthurmoore, sixhours, mamaduka.
see #19978.
git-svn-id: http://core.svn.wordpress.org/trunk@21261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-12 00:20:46 -04:00
|
|
|
* @package WordPress
|
|
|
|
* @subpackage Twenty_Twelve
|
|
|
|
* @since Twenty Twelve 1.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
get_header(); ?>
|
|
|
|
|
2012-08-02 15:12:11 -04:00
|
|
|
<div id="primary" class="site-content">
|
The Twenty Twelve for WordPress.
props drewstrojny, lancewillett.
also props corvannoorloos, jeffsebring, kobenland, iandstewart, mfields,
mtdesign, op12no2, philiparthurmoore, sixhours, mamaduka.
see #19978.
git-svn-id: http://core.svn.wordpress.org/trunk@21261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-12 00:20:46 -04:00
|
|
|
<div id="content" role="main">
|
|
|
|
|
2017-11-30 18:11:00 -05:00
|
|
|
<?php
|
|
|
|
while ( have_posts() ) :
|
|
|
|
the_post();
|
2018-08-16 21:51:36 -04:00
|
|
|
?>
|
The Twenty Twelve for WordPress.
props drewstrojny, lancewillett.
also props corvannoorloos, jeffsebring, kobenland, iandstewart, mfields,
mtdesign, op12no2, philiparthurmoore, sixhours, mamaduka.
see #19978.
git-svn-id: http://core.svn.wordpress.org/trunk@21261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-12 00:20:46 -04:00
|
|
|
|
2012-08-02 15:12:11 -04:00
|
|
|
<article id="post-<?php the_ID(); ?>" <?php post_class( 'image-attachment' ); ?>>
|
The Twenty Twelve for WordPress.
props drewstrojny, lancewillett.
also props corvannoorloos, jeffsebring, kobenland, iandstewart, mfields,
mtdesign, op12no2, philiparthurmoore, sixhours, mamaduka.
see #19978.
git-svn-id: http://core.svn.wordpress.org/trunk@21261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-12 00:20:46 -04:00
|
|
|
<header class="entry-header">
|
|
|
|
<h1 class="entry-title"><?php the_title(); ?></h1>
|
|
|
|
|
|
|
|
<footer class="entry-meta">
|
|
|
|
<?php
|
|
|
|
$metadata = wp_get_attachment_metadata();
|
2017-11-30 18:11:00 -05:00
|
|
|
printf(
|
2019-09-02 20:41:05 -04:00
|
|
|
/* translators: 1: Date, 2: Date, 3: Attachment URL, 4: Image width in pixels, 5: Image height in pixels, 6: Post parent permalink, 7: Post parent title, 8: Post parent title. */
|
2020-11-09 05:53:10 -05:00
|
|
|
__( '<span class="meta-prep meta-prep-entry-date">Published </span> <span class="entry-date"><time class="entry-date" datetime="%1$s">%2$s</time></span> at <a href="%3$s" title="Link to full-size image">%4$s × %5$s</a> in <a href="%6$s" title="Go to %7$s" rel="gallery">%8$s</a>.', 'twentytwelve' ),
|
The Twenty Twelve for WordPress.
props drewstrojny, lancewillett.
also props corvannoorloos, jeffsebring, kobenland, iandstewart, mfields,
mtdesign, op12no2, philiparthurmoore, sixhours, mamaduka.
see #19978.
git-svn-id: http://core.svn.wordpress.org/trunk@21261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-12 00:20:46 -04:00
|
|
|
esc_attr( get_the_date( 'c' ) ),
|
|
|
|
esc_html( get_the_date() ),
|
|
|
|
esc_url( wp_get_attachment_url() ),
|
|
|
|
$metadata['width'],
|
|
|
|
$metadata['height'],
|
|
|
|
esc_url( get_permalink( $post->post_parent ) ),
|
|
|
|
esc_attr( strip_tags( get_the_title( $post->post_parent ) ) ),
|
|
|
|
get_the_title( $post->post_parent )
|
|
|
|
);
|
|
|
|
?>
|
|
|
|
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
|
|
|
|
</footer><!-- .entry-meta -->
|
|
|
|
|
2021-11-01 17:47:13 -04:00
|
|
|
<nav id="image-navigation" class="navigation">
|
The Twenty Twelve for WordPress.
props drewstrojny, lancewillett.
also props corvannoorloos, jeffsebring, kobenland, iandstewart, mfields,
mtdesign, op12no2, philiparthurmoore, sixhours, mamaduka.
see #19978.
git-svn-id: http://core.svn.wordpress.org/trunk@21261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-12 00:20:46 -04:00
|
|
|
<span class="previous-image"><?php previous_image_link( false, __( '← Previous', 'twentytwelve' ) ); ?></span>
|
|
|
|
<span class="next-image"><?php next_image_link( false, __( 'Next →', 'twentytwelve' ) ); ?></span>
|
|
|
|
</nav><!-- #image-navigation -->
|
|
|
|
</header><!-- .entry-header -->
|
|
|
|
|
|
|
|
<div class="entry-content">
|
|
|
|
|
|
|
|
<div class="entry-attachment">
|
|
|
|
<div class="attachment">
|
2018-08-16 21:51:36 -04:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* Grab the IDs of all the image attachments in a gallery so we can get the URL of the next adjacent image in a gallery,
|
|
|
|
* or the first image (if we're looking at the last image in a gallery), or, in a gallery of one, just the link to that image file
|
|
|
|
*/
|
|
|
|
$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',
|
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
foreach ( $attachments as $k => $attachment ) :
|
2023-02-24 01:23:23 -05:00
|
|
|
if ( $attachment->ID === $post->ID ) {
|
2018-08-16 21:51:36 -04:00
|
|
|
break;
|
|
|
|
}
|
2020-01-28 19:45:18 -05:00
|
|
|
endforeach;
|
2012-09-27 03:01:16 -04:00
|
|
|
|
2020-01-28 19:45:18 -05:00
|
|
|
// If there is more than 1 attachment in a gallery...
|
2018-08-16 21:51:36 -04:00
|
|
|
if ( count( $attachments ) > 1 ) :
|
|
|
|
$k++;
|
|
|
|
if ( isset( $attachments[ $k ] ) ) :
|
2020-01-28 19:45:18 -05:00
|
|
|
// ...get the URL of the next image attachment.
|
2018-08-16 21:51:36 -04:00
|
|
|
$next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
|
|
|
|
else :
|
2020-01-28 19:45:18 -05:00
|
|
|
// ...or get the URL of the first image attachment.
|
2018-08-16 21:51:36 -04:00
|
|
|
$next_attachment_url = get_attachment_link( $attachments[0]->ID );
|
|
|
|
endif;
|
2020-01-28 19:45:18 -05:00
|
|
|
else :
|
|
|
|
// Or, if there's only 1 image, get the URL of the image.
|
|
|
|
$next_attachment_url = wp_get_attachment_url();
|
|
|
|
endif;
|
|
|
|
?>
|
2017-11-30 18:11:00 -05:00
|
|
|
<a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment">
|
2020-01-28 19:45:18 -05:00
|
|
|
<?php
|
|
|
|
/**
|
2020-08-10 20:34:08 -04:00
|
|
|
* Filters the image attachment size to use.
|
2020-01-28 19:45:18 -05:00
|
|
|
*
|
|
|
|
* @since Twenty Twelve 1.0
|
|
|
|
*
|
|
|
|
* @param array $size {
|
|
|
|
* @type int The attachment height in pixels.
|
|
|
|
* @type int The attachment width in pixels.
|
|
|
|
* }
|
|
|
|
*/
|
|
|
|
$attachment_size = apply_filters( 'twentytwelve_attachment_size', array( 960, 960 ) );
|
|
|
|
echo wp_get_attachment_image( $post->ID, $attachment_size );
|
|
|
|
?>
|
2017-11-30 18:11:00 -05:00
|
|
|
</a>
|
The Twenty Twelve for WordPress.
props drewstrojny, lancewillett.
also props corvannoorloos, jeffsebring, kobenland, iandstewart, mfields,
mtdesign, op12no2, philiparthurmoore, sixhours, mamaduka.
see #19978.
git-svn-id: http://core.svn.wordpress.org/trunk@21261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-12 00:20:46 -04:00
|
|
|
|
|
|
|
<?php if ( ! empty( $post->post_excerpt ) ) : ?>
|
|
|
|
<div class="entry-caption">
|
|
|
|
<?php the_excerpt(); ?>
|
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
|
|
|
</div><!-- .attachment -->
|
|
|
|
|
|
|
|
</div><!-- .entry-attachment -->
|
|
|
|
|
|
|
|
<div class="entry-description">
|
|
|
|
<?php the_content(); ?>
|
2017-11-30 18:11:00 -05:00
|
|
|
<?php
|
|
|
|
wp_link_pages(
|
|
|
|
array(
|
|
|
|
'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ),
|
|
|
|
'after' => '</div>',
|
|
|
|
)
|
|
|
|
);
|
2018-08-16 21:51:36 -04:00
|
|
|
?>
|
The Twenty Twelve for WordPress.
props drewstrojny, lancewillett.
also props corvannoorloos, jeffsebring, kobenland, iandstewart, mfields,
mtdesign, op12no2, philiparthurmoore, sixhours, mamaduka.
see #19978.
git-svn-id: http://core.svn.wordpress.org/trunk@21261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-12 00:20:46 -04:00
|
|
|
</div><!-- .entry-description -->
|
|
|
|
|
|
|
|
</div><!-- .entry-content -->
|
|
|
|
|
|
|
|
</article><!-- #post -->
|
|
|
|
|
|
|
|
<?php comments_template(); ?>
|
|
|
|
|
2020-01-28 19:45:18 -05:00
|
|
|
<?php endwhile; // End of the loop. ?>
|
The Twenty Twelve for WordPress.
props drewstrojny, lancewillett.
also props corvannoorloos, jeffsebring, kobenland, iandstewart, mfields,
mtdesign, op12no2, philiparthurmoore, sixhours, mamaduka.
see #19978.
git-svn-id: http://core.svn.wordpress.org/trunk@21261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-12 00:20:46 -04:00
|
|
|
|
|
|
|
</div><!-- #content -->
|
2012-08-25 13:16:56 -04:00
|
|
|
</div><!-- #primary -->
|
The Twenty Twelve for WordPress.
props drewstrojny, lancewillett.
also props corvannoorloos, jeffsebring, kobenland, iandstewart, mfields,
mtdesign, op12no2, philiparthurmoore, sixhours, mamaduka.
see #19978.
git-svn-id: http://core.svn.wordpress.org/trunk@21261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-12 00:20:46 -04:00
|
|
|
|
2015-04-12 17:29:32 -04:00
|
|
|
<?php get_footer(); ?>
|