1. 主页
  2. 文档
  3. WordPress函数
  4. add_theme_support
  5. 概述

概述



参考:

这个函数必须在主题的 functions.php 文件中去调用,如果想通过 hook 调用,则必须使用 after_setup_theme 这个 hook,因为 init hook 对于一些功能来说,已经太迟了。

用法

<?php add_theme_support($feature);?>

参数
$feature
(string) (required) 要添加的主题功能的名称。
目前主题支持的功能列表:

‘post-formats’
‘post-thumbnails’
‘custom-background’
‘custom-header’
‘automatic-feed-links’
‘menus’



这篇文章对您有用吗?

我们要如何帮助您?