<?php
/**
 * The template for displaying the footer
 *
 * Contains the closing of the #content div and all content after.
 *
 * @link https://developer.WordPress.org/themes/basics/template-files/#template-partials
 *
 * @package business_office
 */

?>
	</div>

	<footer id="colophon" class="site-footer">
		<div id="footer-widgets" class="container">
			<div class="row">

				<!-- Footer Column 1 - Sidebar 1 -->
				<div class="col-lg-3 col-md-6 footer-widget-area-cols">
					<?php if ( is_active_sidebar( 'sidebar-2' ) ) : ?>
						<?php dynamic_sidebar( 'sidebar-2' ); ?>
					<?php else : ?>
						<section class="widget">
						<h2 class="widget-title"><?php esc_html_e( 'About Us', 'business-office' ); ?></h2>
							<p><?php _e( 'This is default About Us text. Customize this in your widgets area. We are a passionate team dedicated to delivering quality services and exceptional support to our customers every step of the way. With years of experience and a commitment to innovation, we strive to meet the unique needs of every client.', 'business-office' ); ?></p>
						</section>
					<?php endif; ?>
				</div>

				<!-- Footer Column 2 - Sidebar 2 -->
				<div class="col-lg-3 col-md-6 footer-widget-area-cols">
					<?php if ( is_active_sidebar( 'sidebar-3' ) ) : ?>
						<?php dynamic_sidebar( 'sidebar-3' ); ?>
					<?php else : ?>
						<section class="widget">
						<h2 class="widget-title"><?php esc_html_e( 'Recent Posts', 'business-office' ); ?></h2>
							<ul>
								<?php
								$business_office_recent_posts = wp_get_recent_posts( array(
									'numberposts' => 3,
									'post_status' => 'publish',
								) );
								foreach ( $business_office_recent_posts as $business_office_post ) : ?>
									<li>
										<a href="<?php echo esc_url( get_permalink( $business_office_post['ID'] ) ); ?>">
											<?php echo esc_html( $business_office_post['post_title'] ); ?>
										</a>
									</li>
								<?php endforeach; ?>
							</ul>
						</section>
					<?php endif; ?>
				</div>

				<!-- Footer Column 3 - Sidebar 3 -->
				<div class="col-lg-3 col-md-6 footer-widget-area-cols">
					<?php if ( is_active_sidebar( 'sidebar-4' ) ) : ?>
						<?php dynamic_sidebar( 'sidebar-4' ); ?>
					<?php else : ?>
						<section class="widget">
						<h2 class="widget-title"><?php esc_html_e( 'Pages', 'business-office' ); ?></h2>
							<ul>
								<?php
							$business_office_pages = get_pages( array(
								'sort_column' => 'post_date',
								'sort_order'  => 'DESC',
								'number'      => 3, // change number of pages here
							) );

							foreach ( $business_office_pages as $business_office_page ) : ?>
								<li>
									<a href="<?php echo esc_url( get_permalink( $business_office_page->ID ) ); ?>">
										<?php echo esc_html( $business_office_page->post_title ); ?>
										</a>
									</li>
								<?php endforeach; ?>
							</ul>
						</section>
					<?php endif; ?>
				</div>

				<!-- Footer Column 4 - Sidebar 4 -->
				<div class="col-lg-3 col-md-6 footer-widget-area-cols">
					<?php if ( is_active_sidebar( 'sidebar-5' ) ) : ?>
						<?php dynamic_sidebar( 'sidebar-5' ); ?>
					<?php else : ?>
						<section class="widget">
						<h2 class="widget-title"><?php esc_html_e( 'Contact Info', 'business-office' ); ?></h2>
							<ul>
							<li><?php esc_html_e( 'Email: info@example.com', 'business-office' ); ?></li>
							<li><?php esc_html_e( 'Phone: +91-123-456-7890', 'business-office' ); ?></li>
							<li><?php esc_html_e( 'Address: 1234 Elm St, Springfield, IL, USA', 'business-office' ); ?></li>
							</ul>
						</section>
					<?php endif; ?>
				</div>

			</div>
		</div>

		<div class="site-info">
			<div class="container">
				<?php
					if ( ! get_theme_mod('business_office_copyright_option') ) {

						$business_office_theme_name  = wp_get_theme()->get('Name');
						$business_office_theme_uri   = wp_get_theme()->get('ThemeURI');
						$business_office_author_name = wp_get_theme()->get('Author');
						$business_office_author_uri  = wp_get_theme()->get('AuthorURI');
						?>

						<a target="_blank" href="<?php echo esc_url( $business_office_theme_uri ); ?>">
							<?php echo esc_html( $business_office_theme_name ); ?>
						</a>

						<?php echo esc_html(' By '); ?>

						<a target="_blank" href="<?php echo esc_url( $business_office_author_uri ); ?>">
							<?php echo esc_html( $business_office_author_name ); ?>
						</a>

					<?php
					} else {
						echo esc_html( get_theme_mod('business_office_copyright_option') );
					}
				?>
			</div>
		</div>
	</footer>

	<a href="#page" class="to-top"></a>
	
</div>

<?php wp_footer(); ?>

</body>
</html>
