-
Notifications
You must be signed in to change notification settings - Fork 0
Builder – Add New List
Henner R Setyono edited this page Mar 12, 2020
·
4 revisions
Each will be independent and keep their own settings.
NOTE
You need to append the sections array of header_placements:
add_filter( 'custy_default_values', function( $defaults ) {
$defaults['header_placements']['sections'][] = [
'id' => 'sub',
'label' => 'Sub Header',
'mode' => 'placements',
'items' => [
[ 'id' => 'menu', 'values' => $defaults['header']['menu'] ],
[ 'id' => 'logo', 'values' => $defaults['header']['logo'] ],
[ 'id' => 'top-row', 'values' => $defaults['header']['top-row'] ],
[ 'id' => 'middle-row', 'values' => $defaults['header']['middle-row'] ],
[ 'id' => 'bottom-row', 'values' => $defaults['header']['bottom-row'] ],
[ 'id' => 'offcanvas', 'values' => $defaults['header']['offcanvas'] ],
[ 'id' => 'mobile-menu', 'values' => $defaults['header']['mobile-menu'] ],
[ 'id' => 'trigger', 'values' => $defaults['header']['trigger'] ],
],
'desktop' => [
[ 'id' => 'top-row', 'placements' => [
[ 'id' => 'start', 'items' => [] ],
[ 'id' => 'middle', 'items' => [] ],
[ 'id' => 'end', 'items' => [] ],
[ 'id' => 'start-middle', 'items' => [] ],
[ 'id' => 'end-middle', 'items' => [] ],
] ],
[ 'id' => 'middle-row', 'placements' => [
[ 'id' => 'start', 'items' => [ 'logo' ] ],
[ 'id' => 'middle', 'items' => [] ],
[ 'id' => 'end', 'items' => [ 'menu' ] ],
[ 'id' => 'start-middle', 'items' => [] ],
[ 'id' => 'end-middle', 'items' => [] ],
] ],
[ 'id' => 'bottom-row', 'placements' => [
[ 'id' => 'start', 'items' => [] ],
[ 'id' => 'middle', 'items' => [] ],
[ 'id' => 'end', 'items' => [] ],
[ 'id' => 'start-middle', 'items' => [] ],
[ 'id' => 'end-middle', 'items' => [] ],
] ],
],
'mobile' => [
[ 'id' => 'top-row', 'placements' => [
[ 'id' => 'start', 'items' => [] ],
[ 'id' => 'middle', 'items' => [] ],
[ 'id' => 'end', 'items' => [] ],
[ 'id' => 'start-middle', 'items' => [] ],
[ 'id' => 'end-middle', 'items' => [] ],
] ],
[ 'id' => 'middle-row', 'placements' => [
[ 'id' => 'start', 'items' => [ 'logo' ] ],
[ 'id' => 'middle', 'items' => [] ],
[ 'id' => 'end', 'items' => [ 'trigger' ] ],
[ 'id' => 'start-middle', 'items' => [] ],
[ 'id' => 'end-middle', 'items' => [] ],
] ],
[ 'id' => 'bottom-row', 'placements' => [
[ 'id' => 'start', 'items' => [] ],
[ 'id' => 'middle', 'items' => [] ],
[ 'id' => 'end', 'items' => [] ],
[ 'id' => 'start-middle', 'items' => [] ],
[ 'id' => 'end-middle', 'items' => [] ],
] ],
[ 'id' => 'offcanvas', 'placements' => [
[ 'id' => 'start', 'items' => [ 'mobile-menu' ] ],
] ],
],
];
return $defaults;
} );You need to append the sections array of footer_placements:
add_filter( 'custy_default_values', function( $defaults ) {
$defaults['header_placements']['sections'][] = [
'id' => 'sub',
'label' => __( 'Sub Footer' ),
'mode' => 'columns',
'settings' => [],
'items' => [
[ 'id' => 'menu', 'values' => $defaults['footer']['menu'] ],
[ 'id' => 'social', 'values' => $defaults['footer']['social'] ],
[ 'id' => 'copyright', 'values' => $defaults['footer']['copyright'] ],
[ 'id' => 'widget-area-1', 'values' => $defaults['footer']['widget-area-1'] ],
[ 'id' => 'widget-area-2', 'values' => $defaults['footer']['widget-area-2'] ],
[ 'id' => 'widget-area-3', 'values' => $defaults['footer']['widget-area-3'] ],
[ 'id' => 'top-row', 'values' => $defaults['footer']['top-row'] ],
[ 'id' => 'middle-row', 'values' => $defaults['footer']['middle-row'] ],
[ 'id' => 'bottom-row', 'values' => $defaults['footer']['bottom-row'] ],
],
'rows' => [
[ 'id' => 'top-row', 'columns' => [
[ 'menu' ],
[ 'social' ]
] ],
[ 'id' => 'middle-row', 'columns' => [
[ 'widget-area-1' ],
[ 'widget-area-2' ],
[ 'widget-area-3' ],
] ],
[ 'id' => 'bottom-row', 'columns' => [
[ 'copyright' ]
] ],
],
];
return $defaults;
} );Where to apply the code above?
- The option snippet is for New Section Filter
- The value format is for Default Value Filter
Learn more:
