/** * Add body classes for SP pages * * @param array $classes * @return array */ function sp_body_class($classes) { $classes = (array) $classes; if (is_sportspress()) { $classes[] = 'sportspress'; $classes[] = 'sportspress-page'; } $post_type = get_post_type(); if ('sp_event' == $post_type) { $id = get_the_ID(); if (get_option('sportspress_event_show_maps', 'yes') == 'yes' && get_the_terms($id, 'sp_venue')) { $classes[] = 'sp-has-venue'; } if ('results' == sp_get_status($id)) { $classes[] = 'sp-has-results'; } } elseif ('sp_team' == $post_type && 'yes' == get_option('sportspress_team_show_logo', 'yes')) { $classes[] = 'sp-show-image'; } elseif ('sp_player' == $post_type && 'yes' == get_option('sportspress_player_show_photo', 'yes')) { $classes[] = 'sp-show-image'; } elseif ('sp_staff' == $post_type && 'yes' == get_option('sportspress_staff_show_photo', 'yes')) { $classes[] = 'sp-show-image'; } return array_unique($classes); }
/** * Add body classes for SP pages * * @param array $classes * @return array */ function sp_body_class($classes) { $classes = (array) $classes; if (is_sportspress()) { $classes[] = 'sportspress'; $classes[] = 'sportspress-page'; } return array_unique($classes); }