我使用它在管理区域加载css样式(对于任何非管理员的用户):
function wpse_admin_styles() {
if ( !current_user_can( \'manage_options\' ) ) {
echo \'<style>
.fun-stuff-here {color:aqua;}
</style>
\';
}
}
add_action(\'admin_head\', \'wpse_admin_styles\');
但我需要有一些样式只有在管理页面被查看是page (不是帖子或自定义帖子类型帖子)这可能吗?我认为在这个WPSE问题中选择的答案有一定的潜力,但我不知道如何在现有的基础上添加必要的代码:How to add an admin function only to posts, not pages?
我还看到了Wordpress支持论坛的帖子。OP在接近底部的回复(从顶部开始的第8篇帖子)看起来很有希望,但在使用中,它将CSS应用于所有页面、帖子和自定义帖子类型部分:http://wordpress.org/support/topic/add-new-page-button-in-admin-area