How to Add JavaScript and CSS to Gutenberg Blocks the Right Way in Plugins and Themes

How to Add JavaScript and CSS to Gutenberg Blocks the Right Way in Plugins and Themes

While working on my Gutenberg Editor Development Course I had a simple question early on: "How do I enqueue my block JavaScript and CSS to work with the Gutenberg Editor?" The short answer is there are two ways: enqueue_block_editor_assets - For enqueueing JavaScript and CSS in the admin editor only. enqueue_block_assets - Enqueues on both the frontend of the site … Continue reading How to Add JavaScript and CSS to Gutenberg Blocks the Right Way in Plugins and Themes

How to Deregister, Unqueue and Unhook a Parent Theme CSS Stylesheet

There comes a time when working with a WordPress project where you want to not include certain CSS from a parent theme or plugin.  For example, a parent theme may include extra stylesheets that you don't want or a plugin may be adding styles that conflict with your site. On a recent project, I wanted to remove … Continue reading How to Deregister, Unqueue and Unhook a Parent Theme CSS Stylesheet

style.css Comment Code for Twenty Twelve Theme

/* Theme Name: Twenty Twelve Theme URI: http://wordpress.org/extend/themes/twentytwelve Author: the WordPress team Author URI: http://wordpress.org/ Description: The 2012 theme for WordPress is a fully responsive theme that looks great on any device. Features include a front page template with its own widgets, an optional display font, styling for post formats on both index and single … Continue reading style.css Comment Code for Twenty Twelve Theme