-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextras.php
39 lines (35 loc) · 958 Bytes
/
extras.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* Custom functions that act independently of the theme templates.
*
* Eventually, some of the functionality here could be replaced by core features.
*
* @package fmd
*/
/**
* Adds custom classes to the array of body classes.
*
* @param array $classes Classes for the body element.
* @return array
*/
function fmd_body_classes( $classes ) {
// Adds a class of group-blog to blogs with more than 1 published author.
if ( is_multi_author() ) {
$classes[] = 'group-blog';
}
// Adds a class of hfeed to non-singular pages.
if ( ! is_singular() ) {
$classes[] = 'hfeed';
}
return $classes;
}
add_filter( 'body_class', 'fmd_body_classes' );
/**
* Add a pingback url auto-discovery header for singularly identifiable articles.
*/
function fmd_pingback_header() {
if ( is_singular() && pings_open() ) {
echo '<link rel="pingback" href="', bloginfo( 'pingback_url' ), '">';
}
}
add_action( 'wp_head', 'fmd_pingback_header' );