@@ -24,9 +24,10 @@ discard block |
||
24 | 24 | */ |
25 | 25 | |
26 | 26 | function add_gutenberg_compatible_body_class( $classes ) { |
27 | - if ( ! is_home() && ! is_front_page() ) |
|
28 | - if ( is_page() || is_page_template() || is_single() ) |
|
27 | + if ( ! is_home() && ! is_front_page() ) { |
|
28 | + if ( is_page() || is_page_template() || is_single() ) |
|
29 | 29 | $classes[] = 'gutenberg-compatible-template'; |
30 | + } |
|
30 | 31 | return $classes; |
31 | 32 | |
32 | 33 | } |
@@ -35,7 +36,8 @@ discard block |
||
35 | 36 | |
36 | 37 | // Add custom class for templates that are using the Gutenberg editor |
37 | 38 | add_action('body_class', function( $classes ) { |
38 | - if ( function_exists( 'has_blocks' ) && has_blocks( get_the_ID() ) ) |
|
39 | - $classes[] = 'using-gutenberg'; |
|
39 | + if ( function_exists( 'has_blocks' ) && has_blocks( get_the_ID() ) ) { |
|
40 | + $classes[] = 'using-gutenberg'; |
|
41 | + } |
|
40 | 42 | return $classes; |
41 | 43 | }); |