Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pdmade/2a7dfac046a8ea1e829b to your computer and use it in GitHub Desktop.
Save pdmade/2a7dfac046a8ea1e829b to your computer and use it in GitHub Desktop.
Genesis loads the child theme stylesheet very early in the process. This will make sure you child theme's stylesheet loads after the parent theme.
//Don't have Genesis load child theme styles
remove_action( 'genesis_meta', 'genesis_load_stylesheet' );
//* Load parent stylesheet first, then load the child stylesheet
add_action( 'wp_enqueue_scripts', 'load_theme_scripts' );
function load_theme_scripts() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css', array(), CHILD_THEME_VERSION );
wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( 'parent-style' ), CHILD_THEME_VERSION );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment