Skip to content

Instantly share code, notes, and snippets.

@remi
Created January 5, 2010 16:48
Show Gist options
  • Save remi/269513 to your computer and use it in GitHub Desktop.
Save remi/269513 to your computer and use it in GitHub Desktop.
<?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