[Resolved] hide widgets area from "widgets" section

Home Forums Support [Resolved] hide widgets area from "widgets" section

Home Forums Support hide widgets area from "widgets" section

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1273565
    Basello

    Hello,

    I am triing to add a filter to a child theme, in order to hide all the widgets areas from the section “widgets” under “appearance” except for the “Off canvas panel” widget area. I can’t do it. Is there a way to do it?
    can you help me with that please?
    Thank you

    #1274536
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You can use this function: https://developer.wordpress.org/reference/functions/unregister_sidebar/

    add_action( 'widgets_init', function() {
        unregister_sidebar( 'sidebar-1' );
    }, 20 );

    You can find all of the IDs here: https://github.com/tomusborne/generatepress/blob/2.4.2/inc/general.php#L84-L93

    Hope this helps ๐Ÿ™‚

    #1275242
    Basello

    Hi,

    Thank you, it’s help a lot!

    #1275632
    Tom
    Lead Developer
    Lead Developer

    You’re welcome ๐Ÿ™‚

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