Skip to content

Commit

Permalink
added support for Elementor headers and footers
Browse files Browse the repository at this point in the history
  • Loading branch information
BenSibley committed Apr 2, 2020
1 parent 678ed06 commit 33e7728
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

<?php get_sidebar( 'primary' ); ?>

<?php
// Elementor `footer` location
if ( ! function_exists( 'elementor_theme_do_location' ) || ! elementor_theme_do_location( 'footer' ) ) :
?>
<footer id="site-footer" class="site-footer" role="contentinfo">
<?php do_action( 'footer_top' ); ?>
<div class="design-credit">
Expand All @@ -15,6 +19,7 @@
</span>
</div>
</footer>
<?php endif; ?>
</div>
</div><!-- .overflow-container -->

Expand Down
11 changes: 10 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -783,4 +783,13 @@ function ct_apex_output_last_updated_date() {
echo '<p class="last-updated">'. esc_html__("Last updated on", "apex") . ' ' . get_the_modified_date() . ' </p>';
}
}
}
}

//----------------------------------------------------------------------------------
// Add support for Elementor headers & footers
//----------------------------------------------------------------------------------
function ct_apex_register_elementor_locations( $elementor_theme_manager ) {
$elementor_theme_manager->register_location( 'header' );
$elementor_theme_manager->register_location( 'footer' );
}
add_action( 'elementor/theme/register_locations', 'ct_apex_register_elementor_locations' );
5 changes: 5 additions & 0 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
<div id="overflow-container" class="overflow-container">
<div id="max-width" class="max-width">
<?php do_action( 'before_header' ); ?>
<?php
// Elementor `header` location
if ( ! function_exists( 'elementor_theme_do_location' ) || ! elementor_theme_do_location( 'header' ) ) :
?>
<header class="site-header" id="site-header" role="banner">
<div id="menu-primary-container" class="menu-primary-container">
<?php get_template_part( 'menu', 'primary' ); ?>
Expand All @@ -29,6 +33,7 @@
} ?>
</div>
</header>
<?php endif; ?>
<?php do_action( 'after_header' ); ?>
<section id="main" class="main" role="main">
<?php do_action( 'main_top' );
Expand Down

0 comments on commit 33e7728

Please sign in to comment.