summaryrefslogtreecommitdiff
path: root/template-parts/footer/builder
diff options
context:
space:
mode:
Diffstat (limited to 'template-parts/footer/builder')
-rw-r--r--template-parts/footer/builder/components.php166
-rw-r--r--template-parts/footer/builder/desktop-builder-layout.php46
-rw-r--r--template-parts/footer/builder/footer-row.php77
3 files changed, 289 insertions, 0 deletions
diff --git a/template-parts/footer/builder/components.php b/template-parts/footer/builder/components.php
new file mode 100644
index 0000000..87d0778
--- /dev/null
+++ b/template-parts/footer/builder/components.php
@@ -0,0 +1,166 @@
+<?php
+/**
+ * Template part for displaying the footer component.
+ *
+ * @package Astra
+ */
+
+if ( astra_wp_version_compare( '5.4.99', '>=' ) ) {
+
+ $component_slug = wp_parse_args( $args, array( 'type' => '' ) );
+ $component_slug = $component_slug['type'];
+} else {
+
+ $component_slug = get_query_var( 'type' );
+}
+
+switch ( $component_slug ) {
+
+ case 'copyright':
+ ?>
+ <div class="ast-builder-layout-element ast-flex site-footer-focus-item ast-footer-copyright" data-section="section-footer-builder">
+ <?php do_action( 'astra_footer_copyright' ); ?>
+ </div>
+ <?php
+ break;
+
+ case 'social-icons-1':
+ ?>
+ <div class="ast-builder-layout-element ast-flex site-footer-focus-item" data-section="section-fb-social-icons-1">
+ <?php do_action( 'astra_footer_social_1' ); ?>
+ </div>
+ <?php
+ break;
+
+ case 'widget-1':
+ ?>
+ <aside
+ <?php
+ echo astra_attr(
+ 'footer-widget-area-inner',
+ array(
+ 'class' => 'footer-widget-area widget-area site-footer-focus-item',
+ 'data-section' => 'sidebar-widgets-footer-widget-1',
+ 'aria-label' => 'Footer Widget 1',
+ )
+ );
+ ?>
+ >
+ <?php
+ astra_markup_open( 'footer-widget-div' );
+ astra_get_sidebar( 'footer-widget-1' );
+ astra_markup_close( 'footer-widget-div' );
+ ?>
+ </aside>
+ <?php
+ break;
+
+ case 'widget-2':
+ ?>
+ <aside
+ <?php
+ echo astra_attr(
+ 'footer-widget-area-inner',
+ array(
+ 'class' => 'footer-widget-area widget-area site-footer-focus-item',
+ 'data-section' => 'sidebar-widgets-footer-widget-2',
+ 'aria-label' => 'Footer Widget 2',
+ )
+ );
+ ?>
+ >
+ <?php
+ astra_markup_open( 'footer-widget-div' );
+ astra_get_sidebar( 'footer-widget-2' );
+ astra_markup_close( 'footer-widget-div' );
+ ?>
+ </aside>
+ <?php
+ break;
+
+ case 'widget-3':
+ ?>
+ <aside
+ <?php
+ echo astra_attr(
+ 'footer-widget-area-inner',
+ array(
+ 'class' => 'footer-widget-area widget-area site-footer-focus-item',
+ 'data-section' => 'sidebar-widgets-footer-widget-3',
+ 'aria-label' => 'Footer Widget 3',
+ )
+ );
+ ?>
+ >
+ <?php
+ astra_markup_open( 'footer-widget-div' );
+ astra_get_sidebar( 'footer-widget-3' );
+ astra_markup_close( 'footer-widget-div' );
+ ?>
+ </aside>
+ <?php
+ break;
+
+ case 'widget-4':
+ ?>
+ <aside
+ <?php
+ echo astra_attr(
+ 'footer-widget-area-inner',
+ array(
+ 'class' => 'footer-widget-area widget-area site-footer-focus-item',
+ 'data-section' => 'sidebar-widgets-footer-widget-4',
+ 'aria-label' => 'Footer Widget 4',
+ )
+ );
+ ?>
+ >
+ <?php
+ astra_markup_open( 'footer-widget-div' );
+ astra_get_sidebar( 'footer-widget-4' );
+ astra_markup_close( 'footer-widget-div' );
+ ?>
+ </aside>
+ <?php
+ break;
+
+ case 'html-1':
+ ?>
+ <div class="footer-widget-area widget-area site-footer-focus-item ast-footer-html-1" data-section="section-fb-html-1">
+ <?php do_action( 'astra_footer_html_1' ); ?>
+ </div>
+ <?php
+ break;
+
+ case 'html-2':
+ ?>
+ <div class="footer-widget-area widget-area site-footer-focus-item ast-footer-html-2" data-section="section-fb-html-2">
+ <?php do_action( 'astra_footer_html_2' ); ?>
+ </div>
+ <?php
+ break;
+
+ case 'menu':
+ ?>
+ <div class="footer-widget-area widget-area site-footer-focus-item" data-section="section-footer-menu">
+ <?php do_action( 'astra_footer_menu' ); ?>
+ </div>
+ <?php
+ break;
+
+ case 'divider-1':
+ $layout_class = astra_get_option( 'footer-divider-1-layout' );
+ ?>
+ <div class="footer-widget-area widget-area ast-flex site-footer-focus-item ast-footer-divider-element ast-footer-divider-1 ast-fb-divider-layout-<?php echo esc_attr( $layout_class ); ?>" data-section="section-fb-divider-1">
+ <?php do_action( 'astra_footer_divider_1' ); ?>
+ </div>
+ <?php
+ break;
+
+
+ default:
+ do_action( 'astra_render_footer_components', $component_slug );
+ break;
+
+}
+?>
diff --git a/template-parts/footer/builder/desktop-builder-layout.php b/template-parts/footer/builder/desktop-builder-layout.php
new file mode 100644
index 0000000..ef93064
--- /dev/null
+++ b/template-parts/footer/builder/desktop-builder-layout.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Template part for displaying the footer info.
+ *
+ * @link https://codex.wordpress.org/Template_Hierarchy
+ *
+ * @package Astra
+ * @since 1.0.0
+ */
+
+?>
+<footer
+<?php
+echo astra_attr(
+ 'footer',
+ array(
+ 'id' => 'colophon',
+ 'class' => join(
+ ' ',
+ astra_get_footer_classes()
+ ),
+ )
+);
+?>
+>
+ <?php
+ astra_footer_content_top();
+ ?>
+ <?php
+ /**
+ * Astra Top footer
+ */
+ do_action( 'astra_above_footer' );
+ /**
+ * Astra Middle footer
+ */
+ do_action( 'astra_primary_footer' );
+ /**
+ * Astra Bottom footer
+ */
+ do_action( 'astra_below_footer' );
+ ?>
+ <?php
+ astra_footer_content_bottom();
+ ?>
+</footer><!-- #colophon -->
diff --git a/template-parts/footer/builder/footer-row.php b/template-parts/footer/builder/footer-row.php
new file mode 100644
index 0000000..de0198b
--- /dev/null
+++ b/template-parts/footer/builder/footer-row.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Template part for displaying the a row of the footer
+ *
+ * @package Astra Builder
+ */
+
+if ( astra_wp_version_compare( '5.4.99', '>=' ) ) {
+
+ $row = wp_parse_args( $args, array( 'row' => '' ) );
+ $row = $row['row'];
+} else {
+
+ $row = get_query_var( 'row' );
+}
+
+if ( Astra_Builder_Helper::is_footer_row_empty( $row ) ) {
+
+ $option = ( 'above' === $row ) ? 'hba' : ( ( 'below' === $row ) ? 'hbb' : 'hb' );
+ $columns = astra_get_option( $option . '-footer-column' );
+ $layout = astra_get_option( $option . '-footer-layout' );
+ $stack_layout = astra_get_option( $option . '-stack' );
+
+ $desk_layout = ( isset( $layout['desktop'] ) ) ? $layout['desktop'] : 'full';
+ $tab_layout = ( isset( $layout['tablet'] ) ) ? $layout['tablet'] : 'full';
+ $mob_layout = ( isset( $layout['mobile'] ) ) ? $layout['mobile'] : 'full';
+
+ $desk_stack_layout = ( isset( $stack_layout['desktop'] ) ) ? $stack_layout['desktop'] : 'stack';
+ $tab_stack_layout = ( isset( $stack_layout['tablet'] ) ) ? $stack_layout['tablet'] : 'stack';
+ $mob_stack_layout = ( isset( $stack_layout['mobile'] ) ) ? $stack_layout['mobile'] : 'stack';
+
+ $classes = array(
+ 'site-' . esc_attr( $row ) . '-footer-wrap',
+ 'ast-builder-grid-row-container',
+ 'site-footer-focus-item',
+ 'ast-builder-grid-row-' . esc_attr( $desk_layout ),
+ 'ast-builder-grid-row-tablet-' . esc_attr( $tab_layout ),
+ 'ast-builder-grid-row-mobile-' . esc_attr( $mob_layout ),
+ 'ast-footer-row-' . esc_attr( $desk_stack_layout ),
+ 'ast-footer-row-tablet-' . esc_attr( $tab_stack_layout ),
+ 'ast-footer-row-mobile-' . esc_attr( $mob_stack_layout ),
+ );
+ ?>
+<div class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>" data-section="section-<?php echo esc_attr( $row ); ?>-footer-builder">
+ <div class="ast-builder-grid-row-container-inner">
+ <?php
+ if ( is_customize_preview() ) {
+ Astra_Builder_UI_Controller::render_grid_row_customizer_edit_button( 'Footer', $row );
+ }
+
+ /**
+ * Astra Render before Site container of Footer.
+ */
+ do_action( "astra_footer_{$row}_container_before" );
+ ?>
+ <div class="ast-builder-footer-grid-columns site-<?php echo esc_attr( $row ); ?>-footer-inner-wrap ast-builder-grid-row">
+ <?php for ( $zones = 1; $zones <= Astra_Builder_Helper::$num_of_footer_columns; $zones++ ) { ?>
+ <?php
+ if ( $zones > $columns ) {
+ break;
+ }
+ ?>
+ <div class="site-footer-<?php echo esc_attr( $row ); ?>-section-<?php echo esc_attr( $zones ); ?> site-footer-section site-footer-section-<?php echo esc_attr( $zones ); ?>">
+ <?php do_action( 'astra_render_footer_column', $row, $zones ); ?>
+ </div>
+ <?php } ?>
+ </div>
+ <?php
+ /**
+ * Astra Render before Site container of Footer.
+ */
+ do_action( "astra_footer_{$row}_container_after" );
+ ?>
+ </div>
+
+</div>
+<?php } ?>