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

							// Widgets area inside page content
							tourimo_create_widgets_area( 'widgets_below_content' );
						
							?>
						</div><!-- /.content -->
						<?php

						// Show main sidebar
						get_sidebar();
						?>
					</div><!-- /.content_wrap -->
					<?php

					// Widgets area below page content and related posts below page content
					$tourimo_body_style = tourimo_get_theme_option( 'body_style' );
					$tourimo_widgets_name = tourimo_get_theme_option( 'widgets_below_page' );
					$tourimo_show_widgets = ! tourimo_is_off( $tourimo_widgets_name ) && is_active_sidebar( $tourimo_widgets_name );
					$tourimo_show_related = is_single() && tourimo_get_theme_option( 'related_position' ) == 'below_page';
					if ( $tourimo_show_widgets || $tourimo_show_related ) {
						if ( 'fullscreen' != $tourimo_body_style ) {
							?>
							<div class="content_wrap">
							<?php
						}
						// Show related posts before footer
						if ( $tourimo_show_related ) {
							do_action( 'tourimo_action_related_posts' );
						}

						// Widgets area below page content
						if ( $tourimo_show_widgets ) {
							tourimo_create_widgets_area( 'widgets_below_page' );
						}
						if ( 'fullscreen' != $tourimo_body_style ) {
							?>
							</div><!-- /.content_wrap -->
							<?php
						}
					}
					?>
			</div><!-- /.page_content_wrap -->
			<?php

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

				do_action( 'tourimo_action_before_footer' );

				// Footer
				$tourimo_footer_type = tourimo_get_theme_option( 'footer_type' );
				if ( 'custom' == $tourimo_footer_type && ! tourimo_is_layouts_available() ) {
					$tourimo_footer_type = 'default';
				}
				get_template_part( apply_filters( 'tourimo_filter_get_template_part', "templates/footer-{$tourimo_footer_type}" ) );

				do_action( 'tourimo_action_after_footer' );

			}
			?>

		</div><!-- /.page_wrap -->

	</div><!-- /.body_wrap -->

	<?php wp_footer(); ?>

</body>
</html>