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 06:20:46 +02:00
|
|
|
<?php
|
|
|
|
/**
|
2013-09-20 21:24:09 +02: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 06:20:46 +02:00
|
|
|
*
|
2015-04-12 23:29:32 +02:00
|
|
|
* @link https://codex.wordpress.org/Template_Hierarchy
|
2012-09-27 09:01:16 +02: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 06:20:46 +02:00
|
|
|
* @package WordPress
|
|
|
|
* @subpackage Twenty_Twelve
|
|
|
|
* @since Twenty Twelve 1.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
get_header(); ?>
|
|
|
|
|
2012-08-02 21:12:11 +02: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 06:20:46 +02:00
|
|
|
<div id="content" role="main">
|
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
<?php
|
|
|
|
while ( have_posts() ) :
|
|
|
|
the_post();
|
2018-08-17 03:51:36 +02: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 06:20:46 +02:00
|
|
|
|
2012-08-02 21:12:11 +02: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 06:20:46 +02:00
|
|
|
<header class="entry-header">
|
|
|
|
<h1 class="entry-title"><?php the_title(); ?></h1>
|
|
|
|
|
|
|
|
<footer class="entry-meta">
|
|
|
|
<?php
|
|
|
|
$metadata = wp_get_attachment_metadata();
|
2017-12-01 00:11:00 +01:00
|
|
|
printf(
|
|
|
|
__( '<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="Return 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 06:20:46 +02: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 -->
|
|
|
|
|
2012-08-02 21:12:11 +02:00
|
|
|
<nav id="image-navigation" class="navigation" role="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 06:20:46 +02: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-17 03:51:36 +02: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 ) :
|
|
|
|
if ( $attachment->ID == $post->ID ) {
|
|
|
|
break;
|
|
|
|
}
|
2012-09-27 09:01:16 +02:00
|
|
|
endforeach;
|
|
|
|
|
2018-08-17 03:51:36 +02:00
|
|
|
// If there is more than 1 attachment in a gallery
|
|
|
|
if ( count( $attachments ) > 1 ) :
|
|
|
|
$k++;
|
|
|
|
if ( isset( $attachments[ $k ] ) ) :
|
|
|
|
// get the URL of the next image attachment
|
|
|
|
$next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
|
|
|
|
else :
|
|
|
|
// or get the URL of the first image attachment
|
|
|
|
$next_attachment_url = get_attachment_link( $attachments[0]->ID );
|
|
|
|
endif;
|
2012-09-27 09:01:16 +02:00
|
|
|
else :
|
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 06:20:46 +02:00
|
|
|
// or, if there's only 1 image, get the URL of the image
|
|
|
|
$next_attachment_url = wp_get_attachment_url();
|
2012-09-27 09:01:16 +02:00
|
|
|
endif;
|
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 06:20:46 +02:00
|
|
|
?>
|
2017-12-01 00:11:00 +01:00
|
|
|
<a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment">
|
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Filter the image attachment size to use.
|
|
|
|
*
|
|
|
|
* @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 );
|
2018-08-17 03:51:36 +02:00
|
|
|
?>
|
2017-12-01 00:11:00 +01: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 06:20:46 +02: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-12-01 00:11:00 +01:00
|
|
|
<?php
|
|
|
|
wp_link_pages(
|
|
|
|
array(
|
|
|
|
'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ),
|
|
|
|
'after' => '</div>',
|
|
|
|
)
|
|
|
|
);
|
2018-08-17 03:51:36 +02: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 06:20:46 +02:00
|
|
|
</div><!-- .entry-description -->
|
|
|
|
|
|
|
|
</div><!-- .entry-content -->
|
|
|
|
|
|
|
|
</article><!-- #post -->
|
|
|
|
|
|
|
|
<?php comments_template(); ?>
|
|
|
|
|
|
|
|
<?php endwhile; // end of the loop. ?>
|
|
|
|
|
|
|
|
</div><!-- #content -->
|
2012-08-25 19:16:56 +02: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 06:20:46 +02:00
|
|
|
|
2015-04-12 23:29:32 +02:00
|
|
|
<?php get_footer(); ?>
|