我有“后格式”的.php文件的主题。(模板/博客/)。我想在这个文件中更改一些东西,以便需要在子主题中添加此内容。
在子主题中,我创建了文件夹(templates/blog/),然后粘贴文件。根据我的研究,我在子主题function.php中添加了以下代码。函数调用proper。但是当我运行它时,它总是从父主题而不是子主题中获取后格式的.php文件。
add_action( 'after_setup_theme', 'setup_postformats', 10);
//add_action( 'after_setup_theme', 'setup_postformats', 20);
//add_action( 'after_setup_theme', 'setup_postformats', 11);
function setup_postformats(){
remove_theme_support('post-formats');
add_theme_support('post-formats', array(
'aside',
'chat',
'gallery',
'image',
'link',
'quote',
'status',
'video',
'audio'
));
}主题名-林肯,有人能帮我吗?
发布于 2017-01-05 17:03:45
我认为您需要添加在子主题functions.php文件中包含post-format.php的代码。因此,它将使用子主题版本的post-format.php.
希望这能解决你的问题。
感谢并致以问候
https://stackoverflow.com/questions/41480428
复制相似问题