Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 135 lines (88 sloc) 3.637 kb
2aa8890 Importing the initial My Life theme files and folders.
greenshady authored
1 <?php
2 /**
3 * Loop Meta Template
4 *
5 * Displays information at the top of the page about archive and search results when viewing those pages.
6 * This is not shown on the front page or singular views.
7 *
8 * @package MyLife
9 * @subpackage Template
10 * @since 0.1.0
11 * @author Justin Tadlock <justin@justintadlock.com>
877f5cf @justintadlock Update copyright and theme info.
authored
12 * @copyright Copyright (c) 2011 - 2012, Justin Tadlock
2aa8890 Importing the initial My Life theme files and folders.
greenshady authored
13 * @link http://themehybrid.com/themes/my-life
14 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
15 */
16 ?>
17
18 <?php if ( is_home() && !is_front_page() ) : ?>
19
20 <div class="loop-meta">
21
22 <h1 class="loop-title"><?php echo get_post_field( 'post_title', get_queried_object_id() ); ?></h1>
23
24 <div class="loop-description">
25 <?php echo apply_filters( 'the_excerpt', get_post_field( 'post_excerpt', get_queried_object_id() ) ); ?>
26 </div><!-- .loop-description -->
27
28 </div><!-- .loop-meta -->
29
30 <?php elseif ( is_category() ) : ?>
31
32 <div class="loop-meta">
33
34 <h1 class="loop-title"><?php single_cat_title(); ?></h1>
35
36 <div class="loop-description">
37 <?php echo category_description(); ?>
38 </div><!-- .loop-description -->
39
40 </div><!-- .loop-meta -->
41
42 <?php elseif ( is_tag() ) : ?>
43
44 <div class="loop-meta">
45
46 <h1 class="loop-title"><?php single_tag_title(); ?></h1>
47
48 <div class="loop-description">
49 <?php echo tag_description(); ?>
50 </div><!-- .loop-description -->
51
52 </div><!-- .loop-meta -->
53
54 <?php elseif ( is_tax() ) : ?>
55
56 <div class="loop-meta">
57
58 <h1 class="loop-title"><?php single_term_title(); ?></h1>
59
60 <div class="loop-description">
61 <?php echo term_description( '', get_query_var( 'taxonomy' ) ); ?>
62 </div><!-- .loop-description -->
63
64 </div><!-- .loop-meta -->
65
66 <?php elseif ( is_author() ) : ?>
67
68 <?php $user_id = get_query_var( 'author' ); ?>
69
70 <div id="hcard-<?php echo esc_attr( get_the_author_meta( 'user_nicename', $user_id ) ); ?>" class="loop-meta vcard">
71
72 <h1 class="loop-title fn n"><?php the_author_meta( 'display_name', $user_id ); ?></h1>
73
74 <div class="loop-description">
75 <?php echo wpautop( get_the_author_meta( 'description', $user_id ) ); ?>
76 </div><!-- .loop-description -->
77
78 </div><!-- .loop-meta -->
79
80 <?php elseif ( is_search() ) : ?>
81
82 <div class="loop-meta">
83
84 <h1 class="loop-title"><?php echo esc_attr( get_search_query() ); ?></h1>
85
86 <div class="loop-description">
87 <p>
88 <?php printf( __( 'You are browsing the search results for "%s"', 'my-life' ), esc_attr( get_search_query() ) ); ?>
89 </p>
90 </div><!-- .loop-description -->
91
92 </div><!-- .loop-meta -->
93
94 <?php elseif ( is_date() ) : ?>
95
96 <div class="loop-meta">
97 <h1 class="loop-title"><?php _e( 'Archives by date', 'my-life' ); ?></h1>
98
99 <div class="loop-description">
100 <p>
101 <?php _e( 'You are browsing the site archives by date.', 'my-life' ); ?>
102 </p>
103 </div><!-- .loop-description -->
104
105 </div><!-- .loop-meta -->
106
107 <?php elseif ( is_post_type_archive() ) : ?>
108
109 <?php $post_type = get_post_type_object( get_query_var( 'post_type' ) ); ?>
110
111 <div class="loop-meta">
112
113 <h1 class="loop-title"><?php post_type_archive_title(); ?></h1>
114
115 <div class="loop-description">
116 <?php if ( !empty( $post_type->description ) ) echo wpautop( $post_type->description ); ?>
117 </div><!-- .loop-description -->
118
119 </div><!-- .loop-meta -->
120
121 <?php elseif ( is_archive() ) : ?>
122
123 <div class="loop-meta">
124
125 <h1 class="loop-title"><?php _e( 'Archives', 'my-life' ); ?></h1>
126
127 <div class="loop-description">
128 <p>
129 <?php _e( 'You are browsing the site archives.', 'my-life' ); ?>
130 </p>
131 </div><!-- .loop-description -->
132
133 </div><!-- .loop-meta -->
134
135 <?php endif; ?>
Something went wrong with that request. Please try again.