我已输入以下代码functions.php. (用于向客户端隐藏某些选项。)但问题是,添加这些代码后,图像无法上传,甚至无法从库中上传照片或创建新帖子。有人请帮忙
echo \'<style>
#toplevel_page_wpcf7, #wp-admin-bar-wp-logo, #screen-meta-links, #menu-tools, #wp-admin-bar-wpseo-menu, #footer-upgrade, #toplevel_page_wpfront-user-role-editor-all-roles,#toplevel_page_vc-general, #menu-settings,#toplevel_page_wpseo_dashboard, #toplevel_page_revslider, #toplevel_page_themepunch-google-fonts,#menu-appearance, #wp-admin-bar-snap-post, .error
{
display:none;
}
</style>\';
SO网友:Omar Tariq
用以下代码替换您的代码:-
add_action(\'wp_footer\', \'myCssCode\', PHP_INT_MAX);
function myCssCode() {
?>
<style>
#toplevel_page_wpcf7,
#wp-admin-bar-wp-logo,
#screen-meta-links,
#menu-tools,
#wp-admin-bar-wpseo-menu,
#footer-upgrade,
#toplevel_page_wpfront-user-role-editor-all-roles,
#toplevel_page_vc-general,
#menu-settings,
#toplevel_page_wpseo_dashboard,
#toplevel_page_revslider,
#toplevel_page_themepunch-google-fonts,
#menu-appearance,
#wp-admin-bar-snap-post,
.error
{
display:none;
}
</style>
<?php
}
SO网友:Gijo Varghese
<?php
add_action( \'admin_head\', \'admin_css\' );
function admin_css(){ ?>
<style>
#toplevel_page_wpcf7, #wp-admin-bar-wp-logo, #screen-meta-links, #menu-tools, #wp-admin-bar-wpseo-menu, #footer-upgrade, #toplevel_page_wpfront-user-role-editor-all-roles,#toplevel_page_vc-general, #menu-settings,#toplevel_page_wpseo_dashboard, #toplevel_page_revslider, #toplevel_page_themepunch-google-fonts,#menu-appearance, #wp-admin-bar-snap-post, .error
{
display:none;
}
</style>
<?php
}
this one worked