wp/wp-content/themes/twentytwelve/index.php
author ymh <ymh.work@gmail.com>
Thu, 07 Nov 2013 00:08:07 +0000
changeset 1 f6eb5a861d2f
parent 0 d970ebf37754
child 5 5e2f62d02dcd
permissions -rw-r--r--
remove unnessary files. Make timthumb work
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 main template file
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
 * This is the most generic template file in a WordPress theme
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
 * and one of the two required files for a theme (the other being style.css).
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
 * It is used to display a page when nothing more specific matches a query.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
 * For example, it puts together the home page when no home.php file exists.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
 * @link http://codex.wordpress.org/Template_Hierarchy
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
 * @package WordPress
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
 * @subpackage Twenty_Twelve
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
 * @since Twenty Twelve 1.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
get_header(); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
	<div id="primary" class="site-content">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
		<div id="content" role="main">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
		<?php if ( have_posts() ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
			<?php /* Start the Loop */ ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
			<?php while ( have_posts() ) : the_post(); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
				<?php get_template_part( 'content', get_post_format() ); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
			<?php endwhile; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
			<?php twentytwelve_content_nav( 'nav-below' ); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
		<?php else : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
			<article id="post-0" class="post no-results not-found">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
			<?php if ( current_user_can( 'edit_posts' ) ) :
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
				// Show a different message to a logged-in user who can add posts.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
			?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
				<header class="entry-header">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
					<h1 class="entry-title"><?php _e( 'No posts to display', 'twentytwelve' ); ?></h1>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
				</header>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
				<div class="entry-content">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
					<p><?php printf( __( 'Ready to publish your first post? <a href="%s">Get started here</a>.', 'twentytwelve' ), admin_url( 'post-new.php' ) ); ?></p>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
				</div><!-- .entry-content -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
			<?php else :
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
				// Show the default message to everyone else.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    47
			?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    48
				<header class="entry-header">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    49
					<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' ); ?></h1>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    50
				</header>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    51
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    52
				<div class="entry-content">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    53
					<p><?php _e( 'Apologies, but no results were found. Perhaps searching will help find a related post.', 'twentytwelve' ); ?></p>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    54
					<?php get_search_form(); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    55
				</div><!-- .entry-content -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    56
			<?php endif; // end current_user_can() check ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    57
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    58
			</article><!-- #post-0 -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    59
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    60
		<?php endif; // end have_posts() check ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    61
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    62
		</div><!-- #content -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    63
	</div><!-- #primary -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    64
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    65
<?php get_sidebar(); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    66
<?php get_footer(); ?>