Filter body class based on layout settings
This commit is contained in:
@@ -48,12 +48,17 @@ function sp_body_class( $classes ) {
|
|||||||
|
|
||||||
if ( 'sp_event' == $post_type ) {
|
if ( 'sp_event' == $post_type ) {
|
||||||
$id = get_the_ID();
|
$id = get_the_ID();
|
||||||
if ( get_option( 'sportspress_event_show_maps', 'yes' ) == 'yes' && get_the_terms( $id, 'sp_venue' ) ) {
|
$show_venue = get_option( 'sportspress_event_show_venue', 'yes' ) == 'yes' ? true : false;
|
||||||
|
if ( $show_venue && get_the_terms( $id, 'sp_venue' ) ) {
|
||||||
|
if ( get_option( 'sportspress_event_show_maps', 'yes' ) == 'yes' ) {
|
||||||
$classes[] = 'sp-has-venue';
|
$classes[] = 'sp-has-venue';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ( 'results' == sp_get_status( $id ) ) {
|
if ( 'results' == sp_get_status( $id ) ) {
|
||||||
|
if ( get_option( 'sportspress_event_show_results', 'yes' ) == 'yes' ) {
|
||||||
$classes[] = 'sp-has-results';
|
$classes[] = 'sp-has-results';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} elseif ( 'sp_team' == $post_type && 'yes' == get_option( 'sportspress_team_show_logo', 'yes' ) ) {
|
} elseif ( 'sp_team' == $post_type && 'yes' == get_option( 'sportspress_team_show_logo', 'yes' ) ) {
|
||||||
$classes[] = 'sp-show-image';
|
$classes[] = 'sp-show-image';
|
||||||
} elseif ( 'sp_player' == $post_type && 'yes' == get_option( 'sportspress_player_show_photo', 'yes' ) ) {
|
} elseif ( 'sp_player' == $post_type && 'yes' == get_option( 'sportspress_player_show_photo', 'yes' ) ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user