public
Last active

Load a custom style sheet on your site using the Genesis Framework.

  • Download Gist
functions.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<?php
//* Do NOT include the opening php tag
 
//* Load custom style sheet
add_action( 'wp_enqueue_scripts', 'custom_load_custom_style_sheet' );
function custom_load_custom_style_sheet() {
wp_enqueue_style( 'custom-stylesheet', CHILD_URL . '/custom.css', array(), PARENT_THEME_VERSION );
}
 
//* Replace default style sheet
add_filter( 'stylesheet_uri', 'custom_replace_default_style_sheet', 10, 2 );
function custom_replace_default_style_sheet() {
return CHILD_URL . '/custom.css';
}

Awesome :)
Where should the custom.css file be placed?
Is there a way to place it into another folder, so it isn't overwritten when updating a premium child theme?

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.