The MU forums have moved to WordPress.org

Is blog_id the current blog? (3 posts)

  1. johnjamesjacoby
    Member
    Posted 13 years ago #

    Maybe I'm reinventing the wheel, but I wrote up a really simple function to use in templates to check if a specific blog_id is the current one. Useful for highlighting navigation items if you repurpose your blogs into specific site areas and want to have a tabs class be "selected", that kind of thing...

    function is_current_blog( $blog_id ) {
    	global $current_blog;
    
    	if ( $blog_id == $current_blog->blog_id )
    		return true;
    
    	return false;
    }
  2. andrea_r
    Moderator
    Posted 13 years ago #

    Awesome, looks handy.

    Thanks, triple-J. :D

  3. johnjamesjacoby
    Member
    Posted 13 years ago #

    Heeyyoo Andrea_R! I'm stepping into your territory now! Look out! Haha!

About this Topic

  • Started 13 years ago by johnjamesjacoby
  • Latest reply from johnjamesjacoby