Skip to content

Creating Saved Layouts

Chris Reynolds edited this page Nov 9, 2015 · 4 revisions

Since 1.6, layouts are created using an Add New screen similar to adding a post or a page.

The Saved Layouts page shows you a list of all of the layouts you've created. These can be generic layouts that are called directly in your theme template files, area-specific layouts that are used as defaults for those areas, or global layouts used as area defaults.

Saved Layouts

Step 1: Create a new layout

Creating layouts is simple. Click the Add New Layout button from the Saved Layouts page to get started. Select the template parts you want to use.

Note: Any template part is free reign here. It's assumed that in creating a saved layout, you understand which areas these layouts are meant to go. It is possible to break the layout of a page visually by putting a template part into a saved layout and assigning that saved layout to an area that the template part wasn't built to go into. There are currently no safeguards to protect against template parts being saved into layouts assigned to areas that those template parts should not be used in, so don't do it.

Add New Layout

Step 2 (optional, but recommended): Select post types

After you have added the template part or parts you want in this layout, you may select which post types this layout will be used on by default. If none are checked, the layout can only be called directly by using get_saved_page_builder_layout_by_slug. Any number of post types can be selected.

Choose default post type

Step 3: Select an area

Next, you are required to select an area for the layout. If none is selected, the layout will default to the Default Page Builder Area, which may not be where you want this layout to go. Once an area and a post type are selected, you can use the get_saved_page_builder_layout function.

Choose the area

Step 4 (optional): Hide Page Builder meta boxes

Finally, you can choose whether to hide the Page Builder meta boxes for the selected post type(s) if this layout is in use. Maybe you don't want users to see or edit the Page Builder layouts if they are set globally for this post type. Or maybe you'd prefer to allow them to override the defaults. Checking this box will remove the Page Builder meta boxes on all the post types selected so those post types will only ever use the template parts in the saved layout.

Hide metaboxes?