Created
January 5, 2010 16:48
-
-
Save remi/269513 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This filter makes it easy to use the same WordPress theme and resources | |
* accross multiple WordPress MU blogs. | |
*/ | |
function my_global_template_url( $url ) { | |
// Uncomment this to use Amazon S3 | |
// return 'http://mybucket.s3.amazonaws.com'; | |
// Will always use the main blog path to ease browser caching. For example, | |
// it would use `http://mydomain.com/wp-content/themes/mytheme` | |
// even if the current blog is `http://mydomain.com/myblog/`. | |
// (even if `http://mydomain.com/myblog/wp-content/themes/mytheme` would work) | |
global $current_blog; | |
return str_replace( $current_blog->path, '/', $url ); | |
} | |
add_filter('template_directory_uri', 'my_global_template_url'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment