1. 首页
  2. 技术知识

【WordPress相关】WordPress 常用函数 / current_theme_supports

作品分类:Wordpress相关  功能  主题  返回  函数  常用  WordPress  current_theme_supports

WordPress 常用函数 / current_theme_supports,

简介

检查主题是否支持给定的功能。

用法

<?php current_theme_supports( $feature ); ?>

参数

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

<script async src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>

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

Default: None

返回值

(bool)
如果有返回 true,否则返回 false。

修改记录

Since: 2.9.0

源文件

wp-includes/theme.php

原创文章,作者:starterknow,如若转载,请注明出处:https://www.starterknow.com/32059.html

联系我们