在一个十一个子主题的functions.php文件上,我尝试添加视频post格式支持,使用:
add_theme_support('post-formats', array( 'aside', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video', 'audio'));将“视频”格式...adding到数组。但在我删除父主题中的函数之前,它是无法工作的。显然,当主题被更新并且functions.php被覆盖时,我将失去更改。
有什么最好的方法来避免这一点,并增加对我的孩子主题的支持?
谢谢。
发布于 2012-05-16 15:57:30
尝试以较低的优先级运行您的代码:
add_action( 'after_setup_theme', 'my_twentyeleven_setup', 20 );
function my_twentyeleven_setup(){
add_theme_support('post-formats', array(
'aside',
'chat',
'gallery',
'image',
'link',
'quote',
'status',
'video',
'audio',
));
}https://wordpress.stackexchange.com/questions/52320
复制相似问题