Skip to content

Instantly share code, notes, and snippets.

@schlessera
Last active August 29, 2015 14:18
Show Gist options
  • Save schlessera/bede4fa33da512e656ae to your computer and use it in GitHub Desktop.
Save schlessera/bede4fa33da512e656ae to your computer and use it in GitHub Desktop.
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