@@ 142-154 (lines=13) @@ | ||
139 | * |
|
140 | * @return string Full path to author template file. |
|
141 | */ |
|
142 | function get_author_template() { |
|
143 | $author = get_queried_object(); |
|
144 | ||
145 | $templates = array(); |
|
146 | ||
147 | if ( $author instanceof WP_User ) { |
|
148 | $templates[] = "author-{$author->user_nicename}.php"; |
|
149 | $templates[] = "author-{$author->ID}.php"; |
|
150 | } |
|
151 | $templates[] = 'author.php'; |
|
152 | ||
153 | return get_query_template( 'author', $templates ); |
|
154 | } |
|
155 | ||
156 | /** |
|
157 | * Retrieve path of category template in current or parent template. |
|
@@ 172-184 (lines=13) @@ | ||
169 | * |
|
170 | * @return string Full path to category template file. |
|
171 | */ |
|
172 | function get_category_template() { |
|
173 | $category = get_queried_object(); |
|
174 | ||
175 | $templates = array(); |
|
176 | ||
177 | if ( ! empty( $category->slug ) ) { |
|
178 | $templates[] = "category-{$category->slug}.php"; |
|
179 | $templates[] = "category-{$category->term_id}.php"; |
|
180 | } |
|
181 | $templates[] = 'category.php'; |
|
182 | ||
183 | return get_query_template( 'category', $templates ); |
|
184 | } |
|
185 | ||
186 | /** |
|
187 | * Retrieve path of tag template in current or parent template. |
|
@@ 202-214 (lines=13) @@ | ||
199 | * |
|
200 | * @return string Full path to tag template file. |
|
201 | */ |
|
202 | function get_tag_template() { |
|
203 | $tag = get_queried_object(); |
|
204 | ||
205 | $templates = array(); |
|
206 | ||
207 | if ( ! empty( $tag->slug ) ) { |
|
208 | $templates[] = "tag-{$tag->slug}.php"; |
|
209 | $templates[] = "tag-{$tag->term_id}.php"; |
|
210 | } |
|
211 | $templates[] = 'tag.php'; |
|
212 | ||
213 | return get_query_template( 'tag', $templates ); |
|
214 | } |
|
215 | ||
216 | /** |
|
217 | * Retrieve path of taxonomy template in current or parent template. |