Skip to content
This repository
Newer
Older
100644 102 lines (91 sloc) 4.553 kb
43258478 »
2011-04-02 Single and comment templates.
1 <?php
2 /**
3 * The loop that displays posts.
4 *
5 * The loop displays the posts and the post content. See
6 * http://codex.wordpress.org/The_Loop to understand it and
7 * http://codex.wordpress.org/Template_Tags to understand
8 * the tags used in it.
9 *
10 * This can be overridden in child themes with loop.php or
11 * loop-template.php, where 'template' is the loop context
12 * requested by a template. For example, loop-index.php would
13 * be used if it exists and we ask for the loop with:
14 * <code>get_template_part( 'loop', 'index' );</code>
15 *
16 * @package WordPress
6f21dc3e »
2011-04-24 Renaming from 'initializr' to 'formattd'.
17 * @subpackage Formattd
18 * @since Formattd 1.0
43258478 »
2011-04-02 Single and comment templates.
19 */
20 ?>
21
22 <?php /* Display navigation to next/previous pages when applicable */ ?>
23 <?php if ( $wp_query->max_num_pages > 1 ) : ?>
24 <nav id="nav-above" class="navigation">
6f21dc3e »
2011-04-24 Renaming from 'initializr' to 'formattd'.
25 <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'formattd' ) ); ?></div>
26 <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'formattd' ) ); ?></div>
43258478 »
2011-04-02 Single and comment templates.
27 </nav><!-- #nav-above -->
28 <?php endif; ?>
29
30 <?php /* If there are no posts to display, such as an empty archive page */ ?>
31 <?php if ( ! have_posts() ) : ?>
32 <div id="post-0" class="post error404 not-found">
6f21dc3e »
2011-04-24 Renaming from 'initializr' to 'formattd'.
33 <h1 class="entry-title"><?php _e( 'Not Found', 'formattd' ); ?></h1>
43258478 »
2011-04-02 Single and comment templates.
34 <div class="entry-content">
6f21dc3e »
2011-04-24 Renaming from 'initializr' to 'formattd'.
35 <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'formattd' ); ?></p>
43258478 »
2011-04-02 Single and comment templates.
36 <?php get_search_form(); ?>
37 </div><!-- .entry-content -->
38 </div><!-- #post-0 -->
39 <?php endif; ?>
40
41 <?php
42 /* Start the Loop.
43 *
44 * In Intializr we use the same loop in multiple contexts.
45 * It is broken into three main parts: when we're displaying
46 * posts that are in the gallery category, when we're displaying
47 * posts in the asides category, and finally all other posts.
48 *
49 * Additionally, we sometimes check for whether we are on an
50 * archive page, a search page, etc., allowing for small differences
51 * in the loop on each template without actually duplicating
52 * the rest of the loop that is shared.
53 *
54 * Without further ado, the loop:
55 */ ?>
56 <?php while ( have_posts() ) : the_post();
57
6f21dc3e »
2011-04-24 Renaming from 'initializr' to 'formattd'.
58 $comment_number_template = _n( '1 Comments', '% Comments', get_comments_number(), 'formattd' );
43258478 »
2011-04-02 Single and comment templates.
59 // use a format template
60 $format = get_post_format();
61 get_template_part('format', $format);
62
63 if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries ?>
64 <div id="entry-author-info">
65 <div id="author-avatar">
6f21dc3e »
2011-04-24 Renaming from 'initializr' to 'formattd'.
66 <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'formattd_author_bio_avatar_size', 60 ) ); ?>
43258478 »
2011-04-02 Single and comment templates.
67 </div><!-- #author-avatar -->
68 <div id="author-description">
6f21dc3e »
2011-04-24 Renaming from 'initializr' to 'formattd'.
69 <h2><?php printf( esc_attr__( 'About %s', 'formattd' ), get_the_author() ); ?></h2>
43258478 »
2011-04-02 Single and comment templates.
70 <?php the_author_meta( 'description' ); ?>
71 <div id="author-link">
72 <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
6f21dc3e »
2011-04-24 Renaming from 'initializr' to 'formattd'.
73 <?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'formattd' ), get_the_author() ); ?>
43258478 »
2011-04-02 Single and comment templates.
74 </a>
75 </div><!-- #author-link -->
76 </div><!-- #author-description -->
77 </div><!-- #entry-author-info -->
78 <?php endif; ?>
79
80 <div class="entry-utility">
6f21dc3e »
2011-04-24 Renaming from 'initializr' to 'formattd'.
81 <?php formattd_posted_in(); ?>
82 <?php edit_post_link( __( 'Edit', 'formattd' ), '<span class="edit-link">', '</span>' ); ?>
43258478 »
2011-04-02 Single and comment templates.
83 </div><!-- .entry-utility -->
84
85 <div id="nav-below" class="navigation">
6f21dc3e »
2011-04-24 Renaming from 'initializr' to 'formattd'.
86 <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'formattd' ) . '</span> %title' ); ?></div>
87 <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'formattd' ) . '</span>' ); ?></div>
43258478 »
2011-04-02 Single and comment templates.
88 </div><!-- #nav-below -->
7d1d547e »
2011-04-22 Widget area redux.
89 <?php get_sidebar( 'single-insert' ); ?>
43258478 »
2011-04-02 Single and comment templates.
90 <?php comments_template( '', true ); ?>
91
92
93 <?php endwhile; // End the loop. Whew. ?>
94
95 <?php /* Display navigation to next/previous pages when applicable */ ?>
96 <?php if ( $wp_query->max_num_pages > 1 ) : ?>
97 <nav id="nav-below" class="navigation">
6f21dc3e »
2011-04-24 Renaming from 'initializr' to 'formattd'.
98 <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'formattd' ) ); ?></div>
99 <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'formattd' ) ); ?></div>
43258478 »
2011-04-02 Single and comment templates.
100 </nav><!-- #nav-below -->
101 <?php endif; ?>
Something went wrong with that request. Please try again.