<?php
/**
 * The file loading under footer.php
 *
 * @package RB_Themes
 * @subpackage RB_Blog_Two
 */

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
?>

<!--==============================
===== Footer Area Start Here =====
===============================-->
<footer class="site-footer">
	<div class="container">
		<div class="row">
		<?php if ( true === get_theme_mod( 'rbth_copyright_switch' ) ) : ?>
			<div class="col-lg-6">
				<p>
					<?php echo wp_kses_post( get_theme_mod( 'rbth_copyright_text' ), 'rb-blog-two' ); ?>
				</p>
			</div>
		<?php else : ?>
			<div class="col-lg-6">
				<?php
				$from_year = 2022;
				$this_year = esc_html( date_i18n( 'Y' ) );

				$copyright_year = $from_year . ( ( $from_year !== (int) $this_year ) ? '-' . $this_year : '' );

				printf(
					'<p class="copyright-text">%1$s %2$s %3$s <a href="%4$s" target="_blank">%5$s</a> %6$s</p>',
					/* translators: %1$s: Copyright label. */
					esc_html__( '© Copyright', 'rb-blog-two' ),
					/* translators: %2$s: Copyright year range. */
					esc_html( $copyright_year ),
					/* translators: %3$s: Connector text before site name. */
					esc_html__( 'by', 'rb-blog-two' ),
					/* translators: %4$s: Home URL. */
					esc_url( home_url( '/' ) ),
					/* translators: %5$s: Site name. */
					esc_html( get_bloginfo( 'name' ) ),
					/* translators: %6$s: Rights statement. */
					esc_html__( '| All rights reserved.', 'rb-blog-two' )
				);
				?>
			</div>
		<?php endif; ?>

		<?php if ( true === get_theme_mod( 'rbth_poweredby_switch' ) ) : ?>
			<div class="col-lg-6">
				<p>
					<?php echo wp_kses_post( get_theme_mod( 'rbth_poweredby_text' ), 'rb-blog-two' ); ?>
				</p>            
			</div>
		<?php else : ?>
			<div class="col-lg-6">
				<?php
				printf(
					'<p class="powered-by-text float-lg-end">%1$s <a href="%2$s" target="_blank">%3$s</a>%4$s</p>',
					/* translators: %1$s: "Powered by" text. */
					esc_html__( 'Powered by', 'rb-blog-two' ),
					/* translators: %2$s: Powered by URL. */
					esc_url( 'https://bashir-rased.com/' ),
					/* translators: %3$s: Author name. */
					esc_html__( 'Bashir Rased', 'rb-blog-two' ),
					/* translators: %4$s: Ending punctuation. */
					esc_html__( '.', 'rb-blog-two' )
				);
				?>
			</div>
		<?php endif; ?>
		</div><!-- .row -->
	</div><!-- .container -->
</footer>
<!--============================
===== Footer Area End Here =====
=============================--> 