[Support request] Full width page default

Home Forums Support [Support request] Full width page default

Home Forums Support Full width page default

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #303374
    Jason Westbrook

    Is it possible to auto set pages to be full-width globally without having to select it as an option on each page

    #303417
    Tom
    Lead Developer
    Lead Developer

    You could add a function like this:

    add_filter( 'body_class','tu_add_body_class' );
    function tu_add_body_class( $classes ) {
        if ( is_page() ) {
            $classes[] = 'full-width-content';
        }
    
        return $classes;
    }
    #611302
    Steven

    Hi Tom,

    Is there a way to customize this code to include posts as well?

    Thanks a lot

    #611316
    David
    Staff
    Customer Support

    Hi there,

    like this:

    add_filter( 'body_class','tu_add_body_class' );
    function tu_add_body_class( $classes ) {
        if ( is_page() || is_single() ) {
            $classes[] = 'full-width-content';
        }
    
        return $classes;
    }

    GP 1.7 is close to beta release where this becomes super simple ๐Ÿ˜‰

    #611320
    Steven

    Hi David,

    Thanks! Good to know ๐Ÿ™‚

    #611321
    David
    Staff
    Customer Support

    Glad to be of help.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.