The vast majority of Genesis themes support multiple layout options – such as sidebar on the left, sidebar on the right and no sidebar at all. In most cases, you’re not going to use all of them, so Genesis lets you simplify your user experience by unregistering the site layout options you don’t need.
The function to use is
This function accepts a layout ID that you pass to it, and removes the layout with that ID from the list of layout options that will be displayed in your Theme Settings, the editing areas for Posts and Pages and any plugins that might handle the site layout.
The basic code you’ll need to unregister a site layout option is below. Just include the layout ID and repeat for each layout you want to unregister.
For reference, the IDs of the built in site layouts are:
$id – The ID of the layout you want to unregister.
- true if the layout was successfully unregistered
- false if the layout was never registered to start with
- false if no layout ID was passed to the function
There are no filters on the output of this function.
Unregistering a site layout option using
genesis_unregister_layout will hide the layout option from your Theme Settings, the editing areas for Posts and Pages and any plugins that might handle the site layout.
However, it will NOT remove the unregistered layout from any Posts and Pages for which it was previously activated, and it will NOT prevent the unregistered layout from being activated via the filters
genesis_unregister_layout has been included since version 1.4.0.
genesis_unregister_layout is located in lib/functions/layout.php.