Modular Custom CSS

설명

WordPress core provides custom CSS functionality in the customizer that’s specific to the current theme; you can switch themes freely with each theme’s additional CSS remaining in place. Sometimes, you need some CSS to apply regardless of the current theme persistently. This plugin adds a plugin CSS option for CSS that’s global and persists across theme changes.

With the Customizer, your CSS is instantly live-previewed, offering the ability to see exactly how your site will look before you publish your changes. The plugin CSS option is stored as an option. Prior to WordPress 4.7 (which introduced additional CSS in core), theme-specific CSS was stored as a theme_mod, in 4.7 and newer this is migrated to the core CSS functionality (which is theme-specific).

스크린샷

  • Additional CSS Section in the Customizer in WordPress 4.9.

설치

  1. Take the easy route and install through the WordPress plugin installer, OR,
  2. Download the .zip file and upload the unzipped folder to the /wp-content/plugins/ directory
  3. 워드프레스의 ‘플러그인’ 메뉴에서 플러그인을 활성화하세요.
  4. Go to the Customizer (Appearance -> Customize) to add custom CSS to your site.

FAQ

Where is the Custom CSS Stored?

Theme CSS was stored as a theme_mod prior to WordPress 4.7, meaning it is a theme-specific option, part of the theme_mods_$theme option in the database. Each theme has its own theme_mod for the custom CSS, so if you switch to a new theme, the theme-specific custom CSS will be empty. When you switch back to a previously customized theme, the CSS that you added to it will still be there. In WordPress 4.7 and newer this plugin migrates to the core CSS functionality for theme-specific CSS, which is stored with a custom post type.

Plugin CSS is stored as a regular option in the database. It is used for every theme, so it’s best used for things that are plugin-related or anything else you want to persist between different themes.

Why is WordPress 4.0 required?

The Customizer features many improvements in WordPress 4.0, including the textarea control type that this plugin uses. WordPress 4.9 is recommended, as it includes the new CSS editor with syntax highlighting and other features.

후기

2016년 12월 23일
Thanks for this! It seems Modular Custom CSS is the most modern plugin that takes advantage of WP 4.7+ features.
2016년 9월 3일
Thank you for your plugin development. Preview changes in customizer. So good.
모든 6 평가 읽기

기여자 & 개발자

“Modular Custom CSS”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이 플러그인에 기여하였습니다.

기여자

자국어로 “Modular Custom CSS”(을)를 번역하세요.

개발에 관심이 있으십니까?

코드 탐색하기는, SVN 저장소를 확인하시거나, 개발 기록RSS로 구독하세요.

변경이력

2.1

  • Leverage the Code Editing control in WordPress 4.9 to add syntax highlighting, hinting, and more.
  • Add more-descriptive text to the core theme CSS control, to distinguish it from the plugin CSS control.
  • Add plugin textdomain to facilitate translations.

2.0

  • Migrates theme CSS to the core custom CSS functionality in WordPress 4.7.
  • Adjusts the plugin CSS option to use the edit_css capability introduced in WordPress 4.7. As a result, multisite networks will need to provide this capability to site administrators for them to be able to access CSS now.

1.0

  • First publicly available version of the plugin.
  • Requires WordPress 4.0+.