View difference between Paste ID: 7WbDs9v4 and 4RgAjYtg
SHOW: | | - or go back to the newest paste.
1
<?php
2
/**
3
 * The template for displaying posts in the Gallery Post Format on index and archive pages
4
 *
5
 * Learn more: http://codex.wordpress.org/Post_Formats
6
 *
7
 * @package WordPress
8-
 * @subpackage Twenty_Eleven
8+
 * @subpackage Twenty_Twelve
9-
 * @since Twenty Eleven 1.0
9+
10
?>
11
12
<?php if( is_single() ) { get_template_part( 'content' ); return; } //force normal single view of a 'gallery' post format ?>
13
14-
	<header class="entry-header">
14+
15-
		<hgroup>
15+
		<header class="entry-header">
16-
			<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
16+
			<?php the_post_thumbnail(); ?>
17-
			<h3 class="entry-format"><?php _e( 'Gallery', 'twentyeleven' ); ?></h3>
17+
			<h1 class="entry-title">
18-
		</hgroup>
18+
				<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
19
			</h1>
20-
		<div class="entry-meta">
20+
			<h3 class="entry-format"><?php _e( 'Gallery', 'twentytwelve' ); ?></h3>
21-
			<?php twentyeleven_posted_on(); ?>
21+
			<?php if ( comments_open() ) : ?>
22-
		</div><!-- .entry-meta -->
22+
				<div class="comments-link">
23-
	</header><!-- .entry-header -->
23+
					<?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>
24
				</div><!-- .comments-link -->
25-
	<?php if ( is_search() ) : // Only display Excerpts for search pages ?>
25+
			<?php endif; // comments_open() ?>
26-
		<div class="entry-summary">
26+
		</header><!-- .entry-header -->
27
28-
		</div><!-- .entry-summary -->
28+
29-
		<?php else : ?>
29+
30
				<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?>
31
32-
				<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
32+
33
				<?php
34
					$images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
35
					if ( $images ) :
36
						$total_images = count( $images );
37
						$image = array_shift( $images );
38
						$image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );
39
				?>
40
41
				<figure class="gallery-thumb">
42
					<a href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
43
				</figure><!-- .gallery-thumb -->
44
45
				<p><em><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'twentytwelve' ),
46
						'href="' . esc_url( get_permalink() ) . '" title="' . esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ) . '" rel="bookmark"',
47-
				<p><em><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'twentyeleven' ),
47+
48-
						'href="' . esc_url( get_permalink() ) . '" title="' . esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ) . '" rel="bookmark"',
48+
49
			<?php endif; ?>
50
			<?php the_excerpt(); ?>
51
		<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentytwelve' ) . '</span>', 'after' => '</div>' ) ); ?>
52
	</div><!-- .entry-content -->
53-
		<?php endif; ?>
53+
54-
		<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
54+
55
	<footer class="entry-meta">
56
		<?php $show_sep = false; ?>
57
		<?php
58
			/* translators: used between list items, there is a space after the comma */
59
			$categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );
60
			if ( $categories_list ):
61
		?>
62-
			$categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
62+
63
			<?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentytwelve' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
64
			$show_sep = true; ?>
65
		</span>
66-
			<?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
66+
67
		<?php
68
			/* translators: used between list items, there is a space after the comma */
69
			$tags_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) );
70
			if ( $tags_list ):
71
			if ( $show_sep ) : ?>
72-
			$tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
72+
73
			<?php endif; // End if $show_sep ?>
74
		<span class="tag-links">
75
			<?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentytwelve' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
76
			$show_sep = true; ?>
77
		</span>
78-
			<?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
78+
79
80
		<?php if ( comments_open() ) : ?>
81
		<?php if ( $show_sep ) : ?>
82
		<span class="sep"> | </span>
83
		<?php endif; // End if $show_sep ?>
84
		<span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '<b>1</b> Reply', 'twentytwelve' ), __( '<b>%</b> Replies', 'twentytwelve' ) ); ?></span>
85
		<?php endif; // End if comments_open() ?>
86
87-
		<span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
87+
		<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
88
	</footer><!-- .entry-meta -->
89
</article><!-- #post-<?php the_ID(); ?> -->