首页 WordPress函数大全 get_single_template()

get_single_template()

2020-05-01 / 3644阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

get_single_template()

Retrieve path of single template in current or parent template. Applies to single Posts, single Attachments, and single custom post types.

描述

The hierarchy for this template looks like:

  1. {Post Type Template}.php
  2. single-{post_type}-{post_name}.php
  3. single-{post_type}.php
  4. single.php

An example of this is:

  1. templates/full-width.php
  2. single-post-hello-world.php
  3. single-post.php
  4. single.php

The template hierarchy and template path are filterable via the ‘$type_template_hierarchy’ and ‘$type_template’ dynamic hooks, where $type is ‘single’.

See also See also

  • get_query_template()

返回

(string) Full path to single template file.

大家谈论
    我的见解