/
loop-heading.php
162 lines (101 loc) · 4.21 KB
/
loop-heading.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?php
/**
* Loop Meta Template
*
* Displays information at the top of the page about archive and search results when viewing those pages.
* This is not shown on the home page and singular views.
*
* @package YCWL
* @subpackage Template
*/
?>
<?php global $wp_query; ?>
<?php if ( is_home() && !is_front_page() ) : ?>
<div class="loop-meta">
<h3 class="loop-title"><?php echo get_post_field( 'post_title', $wp_query->get_queried_object_id() ); ?></h3>
<?php /*
<div class="loop-description">
<?php echo apply_filters( 'the_excerpt', get_post_field( 'post_excerpt', $wp_query->get_queried_object_id() ) ); ?>
</div><!-- .loop-description -->
*/ ?>
</div><!-- .loop-meta -->
<?php elseif ( is_page() ) : ?>
<div class="loop-meta">
<h3 class="loop-title"><?php echo get_post_field( 'post_title', $wp_query->get_queried_object_id() ); ?></h3>
</div><!-- .loop-meta -->
<?php elseif ( is_singular() && in_category(array('news') ) ) : ?>
<div class="loop-meta">
<h3 class="loop-title"><?php _e('News', hybrid_get_parent_textdomain() ); ?></h3>
</div><!-- .loop-meta -->
<?php elseif ( is_singular() ) : ?>
<div class="loop-meta">
<h3 class="loop-title"><?php _e('Blog', hybrid_get_parent_textdomain() ); ?></h3>
</div><!-- .loop-meta -->
<?php elseif ( is_category() ) : ?>
<div class="loop-meta">
<h3 class="loop-title"><?php single_cat_title(); ?></h3>
<div class="loop-description">
<?php echo category_description(); ?>
</div><!-- .loop-description -->
</div><!-- .loop-meta -->
<?php elseif ( is_tag() ) : ?>
<div class="loop-meta">
<h3 class="loop-title"><?php single_tag_title(); ?></h3>
<div class="loop-description">
<?php echo tag_description(); ?>
</div><!-- .loop-description -->
</div><!-- .loop-meta -->
<?php elseif ( is_tax() ) : ?>
<div class="loop-meta">
<h3 class="loop-title"><?php single_term_title(); ?></h3>
<div class="loop-description">
<?php echo term_description( '', get_query_var( 'taxonomy' ) ); ?>
</div><!-- .loop-description -->
</div><!-- .loop-meta -->
<?php elseif ( is_author() ) : ?>
<?php $id = get_query_var( 'author' ); ?>
<div id="hcard-<?php the_author_meta( 'user_nicename', $id ); ?>" class="loop-meta vcard">
<h3 class="loop-title fn n"><?php the_author_meta( 'display_name', $id ); ?></h3>
<div class="loop-description">
<?php echo get_avatar( get_the_author_meta( 'user_email', $id ), '100', '', get_the_author_meta( 'display_name', $id ) ); ?>
<p class="user-bio">
<?php the_author_meta( 'description', $id ); ?>
</p><!-- .user-bio -->
</div><!-- .loop-description -->
</div><!-- .loop-meta -->
<?php elseif ( is_search() ) : ?>
<div class="loop-meta">
<h3 class="loop-title"><?php echo esc_attr( get_search_query() ); ?></h3>
<div class="loop-description">
<p>
<?php printf( __( 'You are browsing the search results for "%1$s"', hybrid_get_parent_textdomain() ), esc_attr( get_search_query() ) ); ?>
</p>
</div><!-- .loop-description -->
</div><!-- .loop-meta -->
<?php elseif ( is_date() ) : ?>
<div class="loop-meta">
<h3 class="loop-title"><?php _e( 'Archives by date', hybrid_get_parent_textdomain() ); ?></h3>
<div class="loop-description">
<p>
<?php _e( 'You are browsing the site archives by date.', hybrid_get_parent_textdomain() ); ?>
</p>
</div><!-- .loop-description -->
</div><!-- .loop-meta -->
<?php elseif ( is_post_type_archive() ) : ?>
<?php $post_type = get_post_type_object( get_query_var( 'post_type' ) ); ?>
<div class="loop-meta">
<h3 class="loop-title"><?php post_type_archive_title(); ?></h3>
<div class="loop-description">
<?php if ( !empty( $post_type->description ) ) echo "<p>{$post_type->description}</p>"; ?>
</div><!-- .loop-description -->
</div><!-- .loop-meta -->
<?php elseif ( is_archive() ) : ?>
<div class="loop-meta">
<h3 class="loop-title"><?php _e( 'Archives', hybrid_get_parent_textdomain() ); ?></h3>
<div class="loop-description">
<p>
<?php _e( 'You are browsing the site archives.', hybrid_get_parent_textdomain() ); ?>
</p>
</div><!-- .loop-description -->
</div><!-- .loop-meta -->
<?php endif; ?>