Posted on August 2, 2013 , Last Modified on: August 2, 2013
Check on the subdirectory install of a multisite for the the current blog using is_blog()
/**
* Check if we are on the blog given by the slug
*/
if( !function_exists( 'is_blog' ) ):
function is_blog( $slug ){
if( !$slug )
return false;
global $current_blog;
global $current_site;
$sub_path = untrailingslashit( str_replace( $current_site->path, '', $current_blog->path ) );
if( $sub_path == $slug )
return true;
return false;
}
endif;
#multisite, #tips You can use this as below to see if the sub blog is current blog like this
if(is_blog('test')){
//yup, we are on the Test blog where test is the slug /blog name
}