Site logo

[Resolved] Filter hook for Content Container option?

Home Forums Support [Resolved] Filter hook for Content Container option?

Home Forums Support Filter hook for Content Container option?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2487509
    Ash

    I want to use filter hook to change the Content Container option (fullwith/contained) conditionally.
    But I could not find it in the documentation.

    This can not be done with the Elements or css since the condition is tricky, need php.

    #2487811
    David
    Staff
    Customer Support

    Hi there,

    the Layout Element or the Layout Metabox simply adds the relevant class to the <body> tag using the core body_class filter.

    The classes are: full-width-content and contained-content

    Heres an example of the filter:

    add_filter( 'body_class', function( $classes ) {
        $classes[] = 'full-width-content';
    
        return $classes;
    } );
    #2488255
    Ash

    Thank you.

    #2488570
    David
    Staff
    Customer Support

    You’re welcome

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