Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在wordpress管理帖子页面中显示样式_Wordpress_Wordpress Theming - Fatal编程技术网

如何在wordpress管理帖子页面中显示样式

如何在wordpress管理帖子页面中显示样式,wordpress,wordpress-theming,Wordpress,Wordpress Theming,我有一些特定的风格为我的客户网站。例如,所有的链接都是同一种颜色,我也有不同标题的特殊字体。在管理页面中创建帖子时,如何使这些样式也适用?使用admin\u enqueue\u脚本hook将您的样式加入队列: function enqueue_my_admin_style() { wp_enqueue_style( 'yourstyle', get_template_directory_uri() . '/path/to/yourstyle.css', false, '1.0', 'all'

我有一些特定的风格为我的客户网站。例如,所有的链接都是同一种颜色,我也有不同标题的特殊字体。在管理页面中创建帖子时,如何使这些样式也适用?

使用
admin\u enqueue\u脚本
hook将您的样式加入队列:

function enqueue_my_admin_style()
{
  wp_enqueue_style( 'yourstyle', get_template_directory_uri() . '/path/to/yourstyle.css', false, '1.0', 'all');
}
add_action( 'admin_enqueue_scripts', 'enqueue_my_admin_style');
您必须确保CSS选择器同时适用于管理视图和常规视图