GeneratePress

UPDATE:

You can also set this up so that every Elementor page is set to Contained instead of Full Width. The updated code is below the Full Width code.

NOTE: be SURE to have only ONE snippet activated if your create a new one for this instead of modifying the existing Full Width code!

If you are sure that every page you are going to create with Elementor will have the Disable Elements > Content Title disabled and the Page Builder Container set to Full Width, then add the code below to a Code Snippets snippet. Set the snippet to ‘Run snippet everywhere’. Pages or posts created with the WordPress editor will not be affected.

Thanks to Tom Usborne from GeneratePress for this.

image

image

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;
}
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[] = 'contained-content';
  return $classes;
}

Similar Posts

6 Comments

    1. Hi Milan,
      Unfortunately I do not have anything like this for Beaver Builder. But I will have a look around and see if I can find something like it and post it if I do.
      Cheers from Calgary!
      Lyle

      1. If you do find something like that I would be thrilled! It would shorten development time and client training (“why isn’t my new page working right??”) quite a bit 🙂

  1. Hey , Can you please help me with the WordPress elementor>?

    Is here one shortcode for the element or text / title that text go in line go over in points?

    Like this: testeste…
    I Hope that someone can help me!
    Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *