<?php
if ( et_theme_builder_overrides_layout( ET_THEME_BUILDER_HEADER_LAYOUT_POST_TYPE ) || et_theme_builder_overrides_layout( ET_THEME_BUILDER_FOOTER_LAYOUT_POST_TYPE ) ) {
    // Skip rendering anything as this partial is being buffered anyway.
    // In addition, avoids get_sidebar() issues since that uses
    // locate_template() with require_once.
    return;
}

/**
 * Fires after the main content, before the footer is output.
 *
 * @since 3.10
 */
do_action( 'et_after_main_content' );

if ( 'on' === et_get_option( 'divi_back_to_top', 'false' ) ) : ?>

	<span class="et_pb_scroll_top et-pb-icon"></span>

<?php endif;

if ( ! is_page_template( 'page-template-blank.php' ) ) : ?>

			<footer id="main-footer">
				<?php get_sidebar( 'footer' ); ?>


		<?php
			if ( has_nav_menu( 'footer-menu' ) ) : ?>

				<div id="et-footer-nav">
					<div class="container">
						<?php
							wp_nav_menu( array(
								'theme_location' => 'footer-menu',
								'depth'          => '1',
								'menu_class'     => 'bottom-nav',
								'container'      => '',
								'fallback_cb'    => '',
							) );
						?>
					</div>
				</div>

			<?php endif; ?>

				<div id="footer-bottom">
					<div class="container clearfix">
				<?php
					if ( false !== et_get_option( 'show_footer_social_icons', true ) ) {
						get_template_part( 'includes/social_icons', 'footer' );
					}

					// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
					echo et_core_fix_unclosed_html_tags( et_core_esc_previously( et_get_footer_credits() ) );
					// phpcs:enable
				?>
					</div>
				</div>
			</footer>
		</div>

<?php endif; // ! is_page_template( 'page-template-blank.php' ) ?>

	</div>
	<script src="https://kit.fontawesome.com/2fed3568f8.js"></script>
	<script>
		jQuery(document).ready(function() {
			jQuery('.et_pb_module.et_pb_accordion.my_accordion .et_pb_accordion_item.et_pb_toggle_open').addClass('et_pb_toggle_close').removeClass('et_pb_toggle_open');
 });
		$('.et_pb_toggle_title').click(function(){
			var $toggle = $(this).closest('.et_pb_toggle');
			if (!$toggle.hasClass('et_pb_accordion_toggling')) {
			  var $accordion = $toggle.closest('.et_pb_accordion');
			  if ($toggle.hasClass('et_pb_toggle_open')) {
				$accordion.addClass('et_pb_accordion_toggling');
				$toggle.find('.et_pb_toggle_content').slideToggle(700, function() { 
				  $toggle.removeClass('et_pb_toggle_open').addClass('et_pb_toggle_close'); 

				});
			  }
			  setTimeout(function(){ 
				$accordion.removeClass('et_pb_accordion_toggling'); 
			  }, 750);
			}
		  });

	</script>
	<?php wp_footer(); ?>
</body>
</html>
