2012-01-11 03:43:23 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2016-09-27 05:58:22 +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-11-11 22:51:13 +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' );
|
2015-12-04 15:44:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a pingback url auto-discovery header for singularly identifiable articles.
|
|
|
|
*/
|
|
|
|
function _s_pingback_header() {
|
|
|
|
if ( is_singular() && pings_open() ) {
|
|
|
|
echo '<link rel="pingback" href="', bloginfo( 'pingback_url' ), '">';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
add_action( 'wp_head', '_s_pingback_header' );
|