Project

General

Profile

Feature #2301 » content.php

Matt Gold, 2012-11-27 02:28 AM

 
1
<?php
2
/**
3
 * The default template for displaying content. Used for both single and index/archive/search.
4
 *
5
 * @package WordPress
6
 * @subpackage Twenty_Twelve
7
 * @since Twenty Twelve 1.0
8
 */
9
?>
10

    
11
	<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
12
		<?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>
13
		<div class="featured-post">
14
			<?php _e( 'Featured post', 'twentytwelve' ); ?>
15
		</div>
16
		<?php endif; ?>
17
		<header class="entry-header">
18
			<?php the_post_thumbnail(); ?>
19
			<?php if ( is_single() ) : ?>
20
			<h1 class="entry-title"><?php the_title(); ?></h1>
21
			<footer class="entry-meta">
22
			<?php twentytwelve_entry_meta_custom(); ?>
23
			<?php else : ?>
24
			<h1 class="entry-title">
25
				<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>
26
			</h1>
27
			<?php endif; // is_single() ?>
28
			
29
		</header><!-- .entry-header -->
30

    
31
		<?php if ( is_search() ) : // Only display Excerpts for Search ?>
32
		<div class="entry-summary">
33
			<?php the_excerpt(); ?>
34
		</div><!-- .entry-summary -->
35
		<?php else : ?>
36
		<div class="entry-content">
37
			<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?>
38
			<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
39
		</div><!-- .entry-content -->
40
		<?php endif; ?>
41

    
42
		<footer class="entry-meta">
43
			<?php twentytwelve_entry_meta(); ?>
44
			<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
45
			<?php if ( is_singular() && get_the_author_meta( 'description' ) && is_multi_author() ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries. ?>
46
				<div class="author-info">
47
					<div class="author-avatar">
48
						<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentytwelve_author_bio_avatar_size', 68 ) ); ?>
49
					</div><!-- .author-avatar -->
50
					<div class="author-description">
51
						<h2><?php printf( __( 'About %s', 'twentytwelve' ), get_the_author() ); ?></h2>
52
						<p><?php the_author_meta( 'description' ); ?></p>
53
						<div class="author-link">
54
							<a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
55
								<?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'twentytwelve' ), get_the_author() ); ?>
56
							</a>
57
						</div><!-- .author-link	-->
58
					</div><!-- .author-description -->
59
				</div><!-- .author-info -->
60
			<?php endif; ?>
61
		</footer><!-- .entry-meta -->
62
	</article><!-- #post -->
(1-1/4)