2012-01-11 03:43:23 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2015-07-01 15:21:44 +00:00
|
|
|
* Custom functions that act independently of the theme templates.
|
2012-01-11 03:43:23 +00:00
|
|
|
*
|
2015-07-01 15:21:44 +00:00
|
|
|
* Eventually, some of the functionality here could be replaced by core features.
|
2012-01-11 03:43:23 +00:00
|
|
|
*
|
|
|
|
* @package _s
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds custom classes to the array of body classes.
|
2013-11-07 19:41:41 +00:00
|
|
|
*
|
|
|
|
* @param array $classes Classes for the body element.
|
|
|
|
* @return array
|
2012-01-11 03:43:23 +00:00
|
|
|
*/
|
|
|
|
function _s_body_classes( $classes ) {
|
2013-11-07 19:41:41 +00:00
|
|
|
// Adds a class of group-blog to blogs with more than 1 published author.
|
2013-11-14 12:49:50 +00:00
|
|
|
if ( is_multi_author() ) {
|
2012-01-11 03:43:23 +00:00
|
|
|
$classes[] = 'group-blog';
|
2013-11-14 12:49:50 +00:00
|
|
|
}
|
2015-09-16 19:08:02 +00:00
|
|
|
|
|
|
|
// Adds a class of hfeed to non-singular pages.
|
|
|
|
if ( ! is_singular() ) {
|
|
|
|
$classes[] = 'hfeed';
|
|
|
|
}
|
2012-01-11 03:43:23 +00:00
|
|
|
|
|
|
|
return $classes;
|
|
|
|
}
|
|
|
|
add_filter( 'body_class', '_s_body_classes' );
|