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.
However, if none of the built in layout options suit your desired design, Genesis lets you add a new site layout option of your own. For example, you could register a site layout that consists of three sidebars and no main content.
The function to use is
This function accepts a layout ID that you pass to it, and adds a layout with that ID to 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 register a new site layout option is below.
sidebar-sidebar-sidebar with your own desired layout ID, the example label with your own and the example image URL with one that represents your new site layout option. The recommended size is 136×122, because this is the size used for the built in layouts.
$id is the required first argument, while the other three can be included together in an array as a second argument.
$id – An ID for the site layout option.
label – A descriptive name for the site layout option.
Default: No Label Selected
image – the URL of an image that will be used to represent the layout in the layout selectors in Theme Settings and Post and Page editing areas (see below). The recommended size is 136×122, because this is the size used for the built in layouts.
Default: an image reading ‘No Image Available’
type – The layout selectors in Theme Settings and Post and Page editing areas (see below) only load layout options that are registered with a type argument of ‘site’. If you wanted to exclude your layout option from these layout selectors, you can use a different value.
genesis_register_layout returns the arguments that were used to register the layout (either passed to the function, the defaults or a mixture of both), if the layout was successfully registered.
The return value is false if no ID was passed to the function, or if the layout ID is already registered.
There are no filters on the output of this function.
Registering a layout as above will enable you to select the layout in your Theme Settings, when editing Posts and Pages and via any plugins that might handle the site layout. However, it will not apply any design changes.
To handle the design changes you want to make, you can use the function
genesis_register_layout has been included since version 1.4.0.
genesis_register_layout is located in lib/functions/layout.php.
- How to Retrieve the Current Layout Option with Genesis
- How to Unregister a Layout Option with Genesis
- How to Select From Different Layout Options with Genesis
- How to Override the Default Layout Option with Genesis
- How to Force a Layout Option with Genesis
Relevant tutorials from the Genesis community.