GeneratePress

Set no title and full width for every Elementor page with GeneratePress

Get the latest from
Sniffle Valve

Sniffle Valve

Consider buying Sniffle Valve a coffee  

Book a one-on-one online training session

Note: To copy any code presented in these tutorials, hover over the code and select the Toggle RAW Code icon raw code icon

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;
}

4 thoughts on “Set no title and full width for every Elementor page with GeneratePress”

    1. Sniffle Valve

      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. Kyle Schmitt

        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 🙂

Leave a Comment

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