Making WordPress.org


Ignore:
Timestamp:
01/13/2014 07:38:15 PM (11 years ago)
Author:
Otto42
Message:

Add make-sitename to the body class, to allow for make site specific styling. See #269. props iandunn

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-p2/functions.php

    r109 r294  
    5555    return apply_filters( 'cats_with_count', $before . join( $sep, $cat_links ) . $after, $post );
    5656}
     57
     58// Add each site's slug to the body class, so that CSS rules can target specific sites.
     59add_filter( 'body_class', 'wporg_add_site_slug_to_body_class' );
     60function wporg_add_site_slug_to_body_class( $classes ) {
     61    global $current_blog;
     62    $classes[] = 'make-' . trim( $current_blog->path, '/' );
     63    return $classes;
     64}
     65
     66 
Note: See TracChangeset for help on using the changeset viewer.