admin管理员组文章数量:1296469
I always thought that the current theme is saved under the "template" option.
But looking inside the "secret" /wp-admin/options.php
area, I see other related options.
In total, there are three:
- template
- stylesheet
- current_theme
In my WP installation all those three have the exact same value. I would like to know what each of those options really does and which one is storing the actual current theme name that WP uses when loading templates.
It may seem useless as a question but the point is that I am "studying" the WP architecture, and this is one of the current confusion points of the road.
I always thought that the current theme is saved under the "template" option.
But looking inside the "secret" /wp-admin/options.php
area, I see other related options.
In total, there are three:
- template
- stylesheet
- current_theme
In my WP installation all those three have the exact same value. I would like to know what each of those options really does and which one is storing the actual current theme name that WP uses when loading templates.
It may seem useless as a question but the point is that I am "studying" the WP architecture, and this is one of the current confusion points of the road.
Share Improve this question asked Apr 2, 2021 at 15:44 Álvaro FranzÁlvaro Franz 1,1001 gold badge9 silver badges31 bronze badges1 Answer
Reset to default 9All those options are actually pointing to the active theme, but the difference is the value stored in each option:
The options
template
andstylesheet
both store the name of the active theme folder, e.g.twentytwentyone
for theTwenty Twenty-One
theme. But if you're using a child theme, thenstylesheet
would be the name of the child theme folder, e.g.twentytwentyone-child
.current_theme
on the other hand (is or seems like a deprecated option which) stores the name of the active theme on the site, e.g.Twenty Twenty-One
.And this option is used by
get_current_theme()
(a deprecated function) and a deprecated option namedmods_<theme name>
(seeget_theme_mods()
).And note that I don't have this option on my site (default install of WordPress 5.7), but if I had it, then the value would be the same as what
wp_get_theme()->get( 'Name' )
returns.
本文标签: Which WordPress option stores the current active theme
版权声明:本文标题:Which WordPress option stores the current active theme? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741639148a2389814.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论