@@ 237-250 (lines=14) @@ | ||
234 | * |
|
235 | * @return string Full path to taxonomy template file. |
|
236 | */ |
|
237 | function get_taxonomy_template() { |
|
238 | $term = get_queried_object(); |
|
239 | ||
240 | $templates = array(); |
|
241 | ||
242 | if ( ! empty( $term->slug ) ) { |
|
243 | $taxonomy = $term->taxonomy; |
|
244 | $templates[] = "taxonomy-$taxonomy-{$term->slug}.php"; |
|
245 | $templates[] = "taxonomy-$taxonomy.php"; |
|
246 | } |
|
247 | $templates[] = 'taxonomy.php'; |
|
248 | ||
249 | return get_query_template( 'taxonomy', $templates ); |
|
250 | } |
|
251 | ||
252 | /** |
|
253 | * Retrieve path of date template in current or parent template. |
|
@@ 392-405 (lines=14) @@ | ||
389 | * |
|
390 | * @return string Full path to single template file. |
|
391 | */ |
|
392 | function get_single_template() { |
|
393 | $object = get_queried_object(); |
|
394 | ||
395 | $templates = array(); |
|
396 | ||
397 | if ( ! empty( $object->post_type ) ) { |
|
398 | $templates[] = "single-{$object->post_type}-{$object->post_name}.php"; |
|
399 | $templates[] = "single-{$object->post_type}.php"; |
|
400 | } |
|
401 | ||
402 | $templates[] = "single.php"; |
|
403 | ||
404 | return get_query_template( 'single', $templates ); |
|
405 | } |
|
406 | ||
407 | /** |
|
408 | * Retrieves an embed template path in the current or parent template. |
|
@@ 421-437 (lines=17) @@ | ||
418 | * |
|
419 | * @return string Full path to embed template file. |
|
420 | */ |
|
421 | function get_embed_template() { |
|
422 | $object = get_queried_object(); |
|
423 | ||
424 | $templates = array(); |
|
425 | ||
426 | if ( ! empty( $object->post_type ) ) { |
|
427 | $post_format = get_post_format( $object ); |
|
428 | if ( $post_format ) { |
|
429 | $templates[] = "embed-{$object->post_type}-{$post_format}.php"; |
|
430 | } |
|
431 | $templates[] = "embed-{$object->post_type}.php"; |
|
432 | } |
|
433 | ||
434 | $templates[] = "embed.php"; |
|
435 | ||
436 | return get_query_template( 'embed', $templates ); |
|
437 | } |
|
438 | ||
439 | /** |
|
440 | * Retrieves the path of the singular template in current or parent template. |