发布时间:2020-09-17
WordPress 常用函数 / add_theme_support,
允许主题去支持特定的主题功能。
这个函数必须在主题的 functions.php 文件中去调用,如果想通过 hook 调用,则必须使用 after_setup_theme 这个 hook,因为 init hook 对于一些功能来说,已经太迟了。
<?php add_theme_support( $feature ); ?>
$feature
(string) (required) 要添加的主题功能的名称。
目前主题支持的功能列表:
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>
Default: None
无
wp-includes/theme.php
全站搜索