wp/wp-content/themes/twentythirteen/image.php
author ymh <ymh.work@gmail.com>
Mon, 14 Oct 2019 18:30:03 +0200
changeset 10 372f2766ea20
parent 7 cf61fcea0001
permissions -rw-r--r--
update themes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
 * The template for displaying image attachments
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
 *
10
372f2766ea20 update themes
ymh <ymh.work@gmail.com>
parents: 7
diff changeset
     5
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
 * @package WordPress
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
 * @subpackage Twenty_Thirteen
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
 * @since Twenty Thirteen 1.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
get_header(); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
	<div id="primary" class="content-area">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
		<div id="content" class="site-content" role="main">
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    16
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    17
			<?php
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    18
				// Start the Loop.
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    19
			while ( have_posts() ) :
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    20
				the_post();
10
372f2766ea20 update themes
ymh <ymh.work@gmail.com>
parents: 7
diff changeset
    21
				?>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    23
			<article id="post-<?php the_ID(); ?>" <?php post_class( 'image-attachment' ); ?>>
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    24
			<header class="entry-header">
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    25
				<h1 class="entry-title"><?php the_title(); ?></h1>
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    26
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    27
				<div class="entry-meta">
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    28
					<?php
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    29
						$published_text = __( '<span class="attachment-meta">Published on <time class="entry-date" datetime="%1$s">%2$s</time> in <a href="%3$s" title="Return to %4$s" rel="gallery">%5$s</a></span>', 'twentythirteen' );
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    30
						$post_title     = get_the_title( $post->post_parent );
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    31
					if ( empty( $post_title ) || 0 == $post->post_parent ) {
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    32
						$published_text = '<span class="attachment-meta"><time class="entry-date" datetime="%1$s">%2$s</time></span>';
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    33
					}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    35
						printf(
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    36
							$published_text,
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    37
							esc_attr( get_the_date( 'c' ) ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    38
							esc_html( get_the_date() ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    39
							esc_url( get_permalink( $post->post_parent ) ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    40
							esc_attr( strip_tags( $post_title ) ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    41
							$post_title
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    42
						);
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    44
						$metadata = wp_get_attachment_metadata();
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    45
						printf(
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    46
							'<span class="attachment-meta full-size-link"><a href="%1$s" title="%2$s">%3$s (%4$s &times; %5$s)</a></span>',
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    47
							esc_url( wp_get_attachment_url() ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    48
							esc_attr__( 'Link to full-size image', 'twentythirteen' ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    49
							__( 'Full resolution', 'twentythirteen' ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    50
							$metadata['width'],
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    51
							$metadata['height']
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    52
						);
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    53
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    54
						edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' );
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    55
					?>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    56
					</div><!-- .entry-meta -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    57
				</header><!-- .entry-header -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    58
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    59
				<div class="entry-content">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    60
					<nav id="image-navigation" class="navigation image-navigation" role="navigation">
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    61
					<span class="nav-previous"><?php previous_image_link( false, __( '<span class="meta-nav">&larr;</span> Previous', 'twentythirteen' ) ); ?></span>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    62
						<span class="nav-next"><?php next_image_link( false, __( 'Next <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    63
					</nav><!-- #image-navigation -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    64
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    65
					<div class="entry-attachment">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    66
						<div class="attachment">
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    67
						<?php twentythirteen_the_attached_image(); ?>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    68
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    69
						<?php if ( has_excerpt() ) : ?>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    70
							<div class="entry-caption">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    71
								<?php the_excerpt(); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    72
							</div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    73
							<?php endif; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    74
						</div><!-- .attachment -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    75
					</div><!-- .entry-attachment -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    76
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    77
					<?php if ( ! empty( $post->post_content ) ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    78
					<div class="entry-description">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    79
						<?php the_content(); ?>
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    80
						<?php
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    81
						wp_link_pages(
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    82
							array(
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    83
								'before' => '<div class="page-links">' . __( 'Pages:', 'twentythirteen' ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    84
								'after'  => '</div>',
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    85
							)
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    86
						);
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    87
						?>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    88
					</div><!-- .entry-description -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    89
					<?php endif; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    90
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    91
				</div><!-- .entry-content -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    92
			</article><!-- #post -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    93
10
372f2766ea20 update themes
ymh <ymh.work@gmail.com>
parents: 7
diff changeset
    94
				<?php comments_template(); ?>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    95
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    96
			<?php endwhile; // End the loop. ?>
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    97
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    98
		</div><!-- #content -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    99
	</div><!-- #primary -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   100
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   101
<?php get_footer(); ?>