<?php
/**
 * The Footer: widgets area, logo, footer menu and socials
 *
 * @package HYGIA
 * @since HYGIA 1.0
 */

							do_action( 'hygia_action_page_content_end_text' );
							
							// Widgets area below the content
							hygia_create_widgets_area( 'widgets_below_content' );
						
							do_action( 'hygia_action_page_content_end' );
							?>
						</div>
						<?php
						
						do_action( 'hygia_action_after_page_content' );

						// Show main sidebar
						get_sidebar();

						do_action( 'hygia_action_content_wrap_end' );
						?>
					</div>
					<?php

					do_action( 'hygia_action_after_content_wrap' );

					// Widgets area below the page and related posts below the page
					$hygia_body_style = hygia_get_theme_option( 'body_style' );
					$hygia_widgets_name = hygia_get_theme_option( 'widgets_below_page', 'hide' );
					$hygia_show_widgets = ! hygia_is_off( $hygia_widgets_name ) && is_active_sidebar( $hygia_widgets_name );
					$hygia_show_related = hygia_is_single() && hygia_get_theme_option( 'related_position', 'below_content' ) == 'below_page';
					if ( $hygia_show_widgets || $hygia_show_related ) {
						if ( 'fullscreen' != $hygia_body_style ) {
							?>
							<div class="content_wrap">
							<?php
						}
						// Show related posts before footer
						if ( $hygia_show_related ) {
							do_action( 'hygia_action_related_posts' );
						}

						// Widgets area below page content
						if ( $hygia_show_widgets ) {
							hygia_create_widgets_area( 'widgets_below_page' );
						}
						if ( 'fullscreen' != $hygia_body_style ) {
							?>
							</div>
							<?php
						}
					}
					do_action( 'hygia_action_page_content_wrap_end' );
					?>
			</div>
			<?php
			do_action( 'hygia_action_after_page_content_wrap' );

			// Don't display the footer elements while actions 'full_post_loading' and 'prev_post_loading'
			if ( ( ! hygia_is_singular( 'post' ) && ! hygia_is_singular( 'attachment' ) ) || ! in_array ( hygia_get_value_gp( 'action' ), array( 'full_post_loading', 'prev_post_loading' ) ) ) {
				
				// Skip link anchor to fast access to the footer from keyboard
				?>
				<span id="footer_skip_link_anchor" class="hygia_skip_link_anchor"></span>
				<?php

				do_action( 'hygia_action_before_footer' );

				// Footer
				$hygia_footer_type = hygia_get_theme_option( 'footer_type' );
				if ( 'custom' == $hygia_footer_type && ! hygia_is_layouts_available() ) {
					$hygia_footer_type = 'default';
				}
				get_template_part( apply_filters( 'hygia_filter_get_template_part', "templates/footer-" . sanitize_file_name( $hygia_footer_type ) ) );

				do_action( 'hygia_action_after_footer' );

			}
			?>

			<?php do_action( 'hygia_action_page_wrap_end' ); ?>

		</div>

		<?php do_action( 'hygia_action_after_page_wrap' ); ?>

	</div>

	<?php do_action( 'hygia_action_after_body' ); ?>

	<?php wp_footer(); ?>

</body>
</html>