wp_get_theme()函数主要作用是用来获得WordPress主题的相关信息。 参数1:内容为查询的主题名,可选。默认值:null 参数2:主题根要查看的绝对路径。可选。如果没有指定,get_raw_theme_root()用于计算主题根为样式表提供(或当前主题)。默认值:null wp_get_theme()函数详细参数: 当然啦,wp_get_theme()函数还可以指定主题名来获取指定主题的其它信息,如下:
语法
<?php wp_get_theme($stylesheet, $theme_root) ?>
参数
实例
<?php
$theme = wp_get_theme();
echo $theme->get( 'Name' ); //主题名
echo $theme->get( ThemeURI' ); //主题 URL
echo $theme->get( Description' ); //主题描述
echo $theme->get( Author' ); //作者名
?>
<?php
$theme = wp_get_theme( 'Viti' );
if ( $theme->exists() )
echo $theme;
?>
文章标题:WordPress常用函数 wp_get_theme()
文章链接:https://www.wuyanshuo.cn/59.html
更新时间:2022年03月22日
本站大部分内容均收集于网络!若内容若侵犯到您的权益,请发送邮件至:service@wuyanshuo.cn我们将第一时间处理!
资源所需价格并非资源售卖价格,是收集、整理、编辑详情以及本站运营的适当补贴,并且本站不提供任何免费技术支持。
所有资源仅限于参考和学习,版权归原作者所有,更多请阅读无言说网络服务协议。