-
Notifications
You must be signed in to change notification settings - Fork 0
/
body-classes.php
45 lines (41 loc) · 1.27 KB
/
body-classes.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
40
41
42
43
44
45
<?php
//////////////////////////////////////////////
// ADD BODY CLASSES TO PAGES, POSTS, AND ARCHIVES
//////////////////////////////////////////////
function about_body_class( $classes ) {
if ( is_page_template( array(
'page-full-width.php',
) ) ) {
$classes[] = 'full-width';
}
if ( is_page_template( array(
'page-sidebar-left.php',
) ) ) {
$classes[] = 'sidebar-left';
}
if ( is_page_template( array(
'page-sidebar-right.php',
) ) ) {
$classes[] = 'sidebar-right';
}
if ( is_page_template( array(
'page-sidebar-both.php',
) ) ) {
$classes[] = 'sidebar-both';
}
if ( is_post_type_archive('events') ) {
$classes[] = 'events-archive';
}
if ( is_post_type_archive('stories') ) {
$classes[] = 'stories-archive';
}
if ( is_archive( array(
'taxonomy-focus.php',
'taxonomy-region.php',
'taxonomy-season.php',
) ) ) {
$classes[] = 'grantees-archive';
}
return $classes;
}
add_filter( 'body_class','about_body_class' );