Skip to content

Instantly share code, notes, and snippets.

@orenshim
Last active February 19, 2019 08:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orenshim/900cbad097580846bf1c2e88ea2076cd to your computer and use it in GitHub Desktop.
Save orenshim/900cbad097580846bf1c2e88ea2076cd to your computer and use it in GitHub Desktop.
Automatically set Elementor pages full width
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