wp/wp-content/themes/twentytwelve/archive.php
author ymh <ymh.work@gmail.com>
Tue, 09 Jun 2015 11:14:17 +0000
changeset 6 490d5cc509ed
parent 5 5e2f62d02dcd
child 7 cf61fcea0001
permissions -rw-r--r--
update portfolio
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 Archive pages
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
 * Used to display archive-type pages if nothing more specific matches a query.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
 * For example, puts together date-based pages if no date.php file exists.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
 * If you'd like to further customize these archive views, you may create a
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
 * new template file for each specific one. For example, Twenty Twelve already
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
 * has tag.php for Tag archives, category.php for Category archives, and
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
 * author.php for Author archives.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
 *
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    13
 * @link https://codex.wordpress.org/Template_Hierarchy
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
 * @package WordPress
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
 * @subpackage Twenty_Twelve
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
 * @since Twenty Twelve 1.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
get_header(); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
	<section id="primary" class="site-content">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
		<div id="content" role="main">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
		<?php if ( have_posts() ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
			<header class="archive-header">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
				<h1 class="archive-title"><?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
					if ( is_day() ) :
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
						printf( __( 'Daily Archives: %s', 'twentytwelve' ), '<span>' . get_the_date() . '</span>' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
					elseif ( is_month() ) :
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
						printf( __( 'Monthly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentytwelve' ) ) . '</span>' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
					elseif ( is_year() ) :
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
						printf( __( 'Yearly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentytwelve' ) ) . '</span>' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
					else :
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
						_e( 'Archives', 'twentytwelve' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
					endif;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
				?></h1>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
			</header><!-- .archive-header -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
			<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
			/* Start the Loop */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
			while ( have_posts() ) : the_post();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
				/* Include the post format-specific template for the content. If you want to
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
				 * this in a child theme then include a file called called content-___.php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
				 * (where ___ is the post format) and that will be used instead.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    47
				 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    48
				get_template_part( 'content', get_post_format() );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    49
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    50
			endwhile;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    51
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    52
			twentytwelve_content_nav( 'nav-below' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    53
			?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    54
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    55
		<?php else : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    56
			<?php get_template_part( 'content', 'none' ); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    57
		<?php endif; ?>
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><!-- #content -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    60
	</section><!-- #primary -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    61
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    62
<?php get_sidebar(); ?>
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    63
<?php get_footer(); ?>