Unregister and Dequeue Dynamik and Genesis Extender Default Styles

Using Dynamik Website Builder

The situation: Styling the Dynamik child theme using Sass, Bourbon/Bitters/Neat, and Codekit. The plan is to paste the final minified CSS output from Codekit into the custom CSS box in Dynamik.

The problem: Dynamik automatically loads Dynamik and Genesis default styles. I don’t want to use any of these styles and don’t want to waste HTTP requests loading unused stylesheets.

The solution: Jason Seabolt at Cobalt Apps got me started and turned me on to the idea of dequeuing the style sheets. After some experimentation, here’s the code that worked:

Place this code at the bottom of your Dynamik Custom Functions

1
2
3
4
5
6
7
8
9
10
remove_action( 'genesis_meta', 'dynamik_add_stylesheets' );
add_action( 'wp_enqueue_scripts', 'remove_default_stylesheet', 25 );
function remove_default_stylesheet() {
 
    wp_dequeue_style( 'dynamik_design_stylesheet' );
    wp_deregister_style( 'dynamik_design_stylesheet' );
 
    wp_dequeue_style( 'dynamik_genesis_stylesheet' );
    wp_deregister_style( 'dynamik_genesis_stylesheet' );
}

When Using Genesis Extender

A similar issue happens when using the Genesis Extender Plugin. Since all your styles are created by Sass using Codekit and your Sass library, there’s no need to load this empty stylesheet.

Place this code at the bottom of your theme functions.php

1
2
3
4
5
6
7
8
9
10
11
remove_action( 'genesis_meta', 'genesis_extender_load_stylesheets' );
add_action( 'wp_enqueue_scripts', 'remove_default_stylesheet', 25 );
 
function remove_default_stylesheet() {
 
    wp_dequeue_style( 'genesis_extender_add_stylesheets' );
    wp_deregister_style( 'genesis_extender_add_stylesheets' );
 
    wp_dequeue_style( 'genesis-extender-minified' );
    wp_deregister_style( 'genesis-extender-minified' );
}

Sources: wpsites.net, chriswiegman.com,