-
Notifications
You must be signed in to change notification settings - Fork 25
Creating Saved Layouts
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.
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.
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.
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.
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.
Still missing something? Let us know if you think this wiki is missing some information or could use some more details! Open an issue in the issue tracker with the information you're looking for and we'll make sure that information gets added!