Last active
October 4, 2018 06:49
-
-
Save mrdavefoy/a72705fad26991b8120f1e57f98f5470 to your computer and use it in GitHub Desktop.
Automatically set Elementor pages full width
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'template_redirect','tu_add_elementor_filter', 999 ); | |
function tu_add_elementor_filter() { | |
if ( in_array( 'elementor-page elementor-page-' . get_the_ID(), get_body_class() ) ) { | |
add_filter( 'body_class', 'tu_add_elementor_classes' ); | |
add_filter( 'generate_show_title','__return_false' ); | |
} | |
} | |
function tu_add_elementor_classes( $classes ) { | |
$classes[] = 'full-width-content'; | |
return $classes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment