是否可以从编辑/新建帖子页面中删除“帖子格式”元框?这个有争议的博客有很多用户一直在处理这个问题,但它只使用标准格式的帖子。
我是wordpress的新手,如果这是一个非常明显的问题,请原谅。
谢谢
是否可以从编辑/新建帖子页面中删除“帖子格式”元框?这个有争议的博客有很多用户一直在处理这个问题,但它只使用标准格式的帖子。
我是wordpress的新手,如果这是一个非常明显的问题,请原谅。
谢谢
因为您的主题支持post-formats
.
您可以使用插件(或子主题functions.php
) 要挂接到的文件after_setup_theme
延迟并删除主题支持:
<?php
add_action(\'after_setup_theme\', \'wpse65653_remove_formats\', 100);
function wpse65653_remove_formats()
{
remove_theme_support(\'post-formats\');
}
或者在你的主题functions.php
文件:add_theme_support(\'post-formats\');
并将其移除。第一种选择是更好的选择。将它粘贴到插件中,它也会出现在您使用的下一个主题中。
// Higher value on the priority then the default of 10 makes sure this is run after the initial removal.
add_action(\'after_setup_theme\', \'remove_post_format\', 15);
function remove_post_format() {
remove_theme_support(\'post-formats\');
}
这应该放在您的函数中。php文件。最简单也是最好的方法就是输入函数。php下面的函数:
<?php remove_theme_support( $feature ); ?>
$功能(字符串)(必需)—要删除的功能的名称。功能列表:
“post格式”
“post-thumbnails”
“custom-background”
“custom-header”
“automatic-feed-links”
“html5”
“title-tag”
“菜单”
例如,如果要删除帖子格式,可以键入:
add_action( \'init\', \'remove_post_format\');
function remove_post_format() {
remove_theme_support( \'post-formats\' );
}