我正在使用WPStaging创建的一个分阶段站点在我们的网站上测试一个主题更新。那部分似乎工作得很好。然后我升级了主题,从中创建了一个子主题,并将该子主题应用到它。现在,每个帖子、页面甚至菜单的标题都是;加载的子主题;(见下文)。然而,当我编辑页面或帖子时,正确的标题仍然存在(事实上,在编辑器中,页面或帖子的所有内容看起来都是正确的)。有什么想法吗?
所有标题和菜单均更改为“已加载子主题”
1 个回复
最合适的回答,由SO网友:Kevin Vess 整理而成
UUA主题提供了starter child theme 其中包括一个示例style.css
文件和functions.php
文件这些文件包含几行代码,用于测试子主题是否正确加载。
您需要从这两个文件中删除此测试代码,该文件在代码注释中标识。
具体来说,此代码在函数中。php:
/**
* Below is a test to confirm the parent theme is being overridden by the child.
* If your page titles say, "Child Theme Loaded," the child theme is working.
* After you confirm it\'s working, delete this function and filter.
*/
function uuatheme_title() {
return "Child Theme Loaded";
}
add_filter( \'the_title\', \'uuatheme_title\' );
这段代码的风格。css:/**
* Below is a test to confirm this stylesheet is being applied.
* It turns all text to all caps. DELETE this after confirmation.
*/
body {
text-transform: uppercase !important;
}