添加样式以在WordPress cms中添加帖子页面

添加样式以在WordPress cms中添加帖子页面,wordpress,twitter-bootstrap-3,Wordpress,Twitter Bootstrap 3,如何将样式文件(如引导)添加到“添加帖子”菜单的页面 我喜欢在“添加帖子”页面的元框中添加样式/// 在这里拍照 这可以解决我的问题:) }试试这个: add_action( 'admin_enqueue_scripts', 'admin_enqueue_scripts' ); admin_enqueue_scripts($hook) { $theme_url = get_template_directory_uri(); wp_enqueue_style( 'bootstra

如何将样式文件(如引导)添加到“添加帖子”菜单的页面

我喜欢在“添加帖子”页面的元框中添加样式/// 在这里拍照

这可以解决我的问题:)

}试试这个:

add_action( 'admin_enqueue_scripts', 'admin_enqueue_scripts' );

admin_enqueue_scripts($hook) { 
   $theme_url = get_template_directory_uri();
   wp_enqueue_style( 'bootstrap', $theme_url . '/css/bootstrap.min.css' );
}
试试这个

//Include CSS file for your plugin
function plugin_name_scripts() {
    wp_enqueue_style( 'your-css-handler',  plugin_dir_url( __FILE__ ) . 'editor/css/style.css' );
}

//enqueue the css file hook
add_action( 'wp_enqueue_scripts', 'plugin_name_scripts' );

试试这个,也许这就是你的解决方案。它将在“管理”面板中的“添加帖子”和“帖子编辑”页面上添加样式

function load_custom_wp_admin_style( $hook ) {
  // Load only add post page and post edit page
  if( $hook == 'post.php' || $hook == 'post-new.php' ) {
    wp_enqueue_style( 'your-css-handler', get_template_directory_uri() . '/editor/css/my-style.css' );
  }    
}
add_action( 'admin_enqueue_scripts', 'load_custom_wp_admin_style' );

谢谢,如何添加我的插件样式文件?我的风格插件文件在编辑器/css目录中你可以查看这篇文章,了解更多的
函数myplugin_scripts(){wp_register_style('foo styles',plugin_dir_url('foo file_uuu)。'assets/foo styles.css');wp_enqueue_style('foo styles');}添加动作('wp_enqueue_scripts','myplugin_uscripts')坦克你,但我喜欢添加风格在我的插件元框在添加后页!我的朋友,这个cod解决了我的问题:)函数加载\自定义\管理\样式(){wp \注册\样式('custom \ wp \管理\ css',editor \ css \ url。'editor \ boot \ css.css',false,'1.0.0');wp \排队\样式('custom \ wp \ admin \ css');wp \注册\样式('custom_wp_admin_css_2',editor_css_url。'editor_main_style.css',false,'1.0.0');wp_enqueue_style('custom_wp_admin_css_2');)
function load_custom_wp_admin_style( $hook ) {
  // Load only add post page and post edit page
  if( $hook == 'post.php' || $hook == 'post-new.php' ) {
    wp_enqueue_style( 'your-css-handler', get_template_directory_uri() . '/editor/css/my-style.css' );
  }    
}
add_action( 'admin_enqueue_scripts', 'load_custom_wp_admin_style' );