Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Modify location of main stylesheet
<?php
/**
* Modify location of main stylesheet
* N.B.: style.css in the theme's root is still needed to provide WordPress
* with the necessary metadata about the theme
* @author Alain Schlesser (alain.schlesser@gmail.com)
*
* @param string $stylesheet_uri Stylesheet URI for the current theme/
* child theme
* @param string $stylesheet_dir_uri Stylesheet directory URI for the current
* theme/child theme
* @return string modified Stylesheet URI
*
* @see https://codex.wordpress.org/Function_Reference/get_stylesheet_uri
* @see http://wpseek.com/hook/stylesheet_uri/
*/
function as_stylesheet_uri( $stylesheet_uri, $stylesheet_dir_uri ) {
return $stylesheet_dir_uri . '/assets/styles/theme.css';
}
add_filter( 'stylesheet_uri', 'as_stylesheet_uri', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.