load_dependencies(); add_action( 'brandy_header', array( $this, 'render_header' ) ); add_action( 'brandy_render_header_placement', array( $this, 'render_placement' ), 10, 3 ); } private function load_dependencies() { ToggleOffCanvasBuilder::get_instance(); } public function render_header() { get_template_part( 'template-parts/builder/header/header-layout' ); } public function render_placement( string $row, $device, $column_count ) { $current_template = brandy_get_header_template(); $columns = $current_template['placements'][ 'tablet' === $device ? 'mobile' : $device ][ $row ]; foreach ( $columns as $col_index => $col_elements ) { if ( empty( $col_elements ) && $column_count < 3 ) { continue; } $is_center = count( $columns ) % 2 !== 0 && intval( count( $columns ) / 2 ) == $col_index; $col_attributes = array( 'class' => 'header-col col-' . ( $col_index + 1 ), ); if ( $is_center ) { $col_attributes['class'] .= ' is-center justify-center'; } if ( $col_index > ( count( $columns ) / 2 ) ) { $col_attributes['class'] .= ' justify-end'; } ?>