Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 121 lines (76 sloc) 3.437 kb
217f7fd Importing the News 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 home page and singular views.
7 *
8 * @package News
9 * @subpackage Template
10 */
11 ?>
12
13 <?php if ( is_category() ) : ?>
14
15 <div class="loop-meta">
16
17 <h1 class="loop-title"><?php single_cat_title(); ?></h1>
18
19 <?php $description = category_description(); ?>
20
21 <?php if ( !empty( $description ) ) echo '<div class="loop-description">' . $description . '</div>'; ?>
22
23 </div><!-- .loop-meta -->
24
25 <?php elseif ( is_tag() ) : ?>
26
27 <div class="loop-meta">
28
29 <h1 class="loop-title"><?php single_tag_title(); ?></h1>
30
31 <?php $description = tag_description(); ?>
32
33 <?php if ( !empty( $description ) ) echo '<div class="loop-description">' . $description . '</div>'; ?>
34
35 </div><!-- .loop-meta -->
36
37 <?php elseif ( is_tax() ) : ?>
38
39 <div class="loop-meta">
40
41 <h1 class="loop-title"><?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); echo $term->name; ?></h1>
42
43 <?php $description = term_description( '', get_query_var( 'taxonomy' ) ); ?>
44
45 <?php if ( !empty( $description ) ) echo '<div class="loop-description">' . $description . '</div>'; ?>
46
47 </div><!-- .loop-meta -->
48
49 <?php elseif ( is_author() ) : ?>
50
51 <?php $id = get_query_var( 'author' ); ?>
52
53 <div id="hcard-<?php the_author_meta( 'user_nicename', $id ); ?>" class="loop-meta vcard">
54
55 <h1 class="loop-title fn n"><?php the_author_meta( 'display_name', $id ); ?></h1>
56
57 <?php $description = get_the_author_meta( 'description', $id ); ?>
58
59 <?php if ( !empty( $description ) ) {
60 $avatar = get_avatar( get_the_author_meta( 'user_email', $id ), '100', '', get_the_author_meta( 'display_name', $id ) );
61 echo '<div class="loop-description">' . $avatar . $description . '</div>';
62 } ?>
63
64 </div><!-- .loop-meta -->
65
66 <?php elseif ( is_search() ) : ?>
67
68 <div class="loop-meta">
69
70 <h1 class="loop-title"><?php echo esc_attr( get_search_query() ); ?></h1>
71
72 <div class="loop-description">
73 <p>
74 <?php printf( __( 'You are browsing the search results for &quot;%1$s&quot;', hybrid_get_textdomain() ), esc_attr( get_search_query() ) ); ?>
75 </p>
76 </div><!-- .loop-description -->
77
78 </div><!-- .loop-meta -->
79
80 <?php elseif ( is_date() ) : ?>
81
82 <div class="loop-meta">
83 <h1 class="loop-title"><?php _e( 'Archives by date', hybrid_get_textdomain() ); ?></h1>
84
85 <div class="loop-description">
86 <p>
87 <?php _e( 'You are browsing the site archives by date.', hybrid_get_textdomain() ); ?>
88 </p>
89 </div><!-- .loop-description -->
90
91 </div><!-- .loop-meta -->
92
93 <?php elseif ( is_archive() ) : ?>
94
95 <div class="loop-meta">
96
97 <h1 class="loop-title"><?php _e( 'Archives', hybrid_get_textdomain() ); ?></h1>
98
99 <div class="loop-description">
100 <p>
101 <?php _e( 'You are browsing the site archives.', hybrid_get_textdomain() ); ?>
102 </p>
103 </div><!-- .loop-description -->
104
105 </div><!-- .loop-meta -->
106
107 <?php elseif ( is_page_template( 'page-template-popular.php' ) ) : ?>
108
109 <div class="loop-meta">
110
111 <h1 class="loop-title"><?php _e( 'Most Popular', hybrid_get_textdomain() ); ?></h1>
112
113 <div class="loop-description">
114 <p>
115 <?php _e( 'You are browsing the site archives by popularity.', hybrid_get_textdomain() ); ?>
116 </p>
117 </div><!-- .loop-description -->
118
119 </div><!-- .loop-meta -->
120
121 <?php endif; ?>
Something went wrong with that request. Please try again.