wp/wp-content/themes/twentytwelve/index.php
changeset 7 cf61fcea0001
parent 5 5e2f62d02dcd
equal deleted inserted replaced
6:490d5cc509ed 7:cf61fcea0001
    19 	<div id="primary" class="site-content">
    19 	<div id="primary" class="site-content">
    20 		<div id="content" role="main">
    20 		<div id="content" role="main">
    21 		<?php if ( have_posts() ) : ?>
    21 		<?php if ( have_posts() ) : ?>
    22 
    22 
    23 			<?php /* Start the Loop */ ?>
    23 			<?php /* Start the Loop */ ?>
    24 			<?php while ( have_posts() ) : the_post(); ?>
    24 			<?php
       
    25 			while ( have_posts() ) :
       
    26 				the_post();
       
    27 ?>
    25 				<?php get_template_part( 'content', get_post_format() ); ?>
    28 				<?php get_template_part( 'content', get_post_format() ); ?>
    26 			<?php endwhile; ?>
    29 			<?php endwhile; ?>
    27 
    30 
    28 			<?php twentytwelve_content_nav( 'nav-below' ); ?>
    31 			<?php twentytwelve_content_nav( 'nav-below' ); ?>
    29 
    32 
    30 		<?php else : ?>
    33 		<?php else : ?>
    31 
    34 
    32 			<article id="post-0" class="post no-results not-found">
    35 			<article id="post-0" class="post no-results not-found">
    33 
    36 
    34 			<?php if ( current_user_can( 'edit_posts' ) ) :
    37 			<?php
       
    38 			if ( current_user_can( 'edit_posts' ) ) :
    35 				// Show a different message to a logged-in user who can add posts.
    39 				// Show a different message to a logged-in user who can add posts.
    36 			?>
    40 			?>
    37 				<header class="entry-header">
    41 				<header class="entry-header">
    38 					<h1 class="entry-title"><?php _e( 'No posts to display', 'twentytwelve' ); ?></h1>
    42 					<h1 class="entry-title"><?php _e( 'No posts to display', 'twentytwelve' ); ?></h1>
    39 				</header>
    43 				</header>
    40 
    44 
    41 				<div class="entry-content">
    45 				<div class="entry-content">
    42 					<p><?php printf( __( 'Ready to publish your first post? <a href="%s">Get started here</a>.', 'twentytwelve' ), admin_url( 'post-new.php' ) ); ?></p>
    46 					<p><?php printf( __( 'Ready to publish your first post? <a href="%s">Get started here</a>.', 'twentytwelve' ), admin_url( 'post-new.php' ) ); ?></p>
    43 				</div><!-- .entry-content -->
    47 				</div><!-- .entry-content -->
    44 
    48 
    45 			<?php else :
    49 			<?php
       
    50 			else :
    46 				// Show the default message to everyone else.
    51 				// Show the default message to everyone else.
    47 			?>
    52 			?>
    48 				<header class="entry-header">
    53 				<header class="entry-header">
    49 					<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' ); ?></h1>
    54 					<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' ); ?></h1>
    50 				</header>
    55 				</header>