<?php
/**
 * The template for displaying the footer.
 * @package Food Truck Lite
 */
?>
<?php if( get_theme_mod( 'food_truck_lite_hide_scroll',true) != '') { ?>
  <?php $food_truck_lite_scroll_align = get_theme_mod( 'food_truck_lite_back_to_top','Right');
  if($food_truck_lite_scroll_align == 'Left'){ ?>
    <a href="#content" class="back-to-top scroll-left text-center"><?php esc_html_e('Top', 'catering-lite'); ?><span class="screen-reader-text"><?php esc_html_e('Back to Top', 'catering-lite'); ?></span></a>
  <?php }else if($food_truck_lite_scroll_align == 'Center'){ ?>
    <a href="#content" class="back-to-top scroll-center text-center"><?php esc_html_e('Top', 'catering-lite'); ?><span class="screen-reader-text"><?php esc_html_e('Back to Top', 'catering-lite'); ?></span></a>
  <?php }else{ ?>
    <a href="#content" class="back-to-top scroll-right text-center"><?php esc_html_e('Top', 'catering-lite'); ?><span class="screen-reader-text"><?php esc_html_e('Back to Top', 'catering-lite'); ?></span></a>
  <?php }?>
<?php }?>
<footer role="contentinfo" id="footer">
  <?php //Set widget areas classes based on user choice
    $food_truck_lite_footer_columns = get_theme_mod('food_truck_lite_footer_widget', '4');
    if ($food_truck_lite_footer_columns == '3') {
      $food_truck_lite_cols = 'col-lg-4 col-md-4';
    } elseif ($food_truck_lite_footer_columns == '4') {
      $food_truck_lite_cols = 'col-lg-3 col-md-3';
    } elseif ($food_truck_lite_footer_columns == '2') {
      $food_truck_lite_cols = 'col-lg-6 col-md-6';
    } else {
      $food_truck_lite_cols = 'col-lg-12 col-md-12';
    }
  ?>

  <?php if (get_theme_mod('food_truck_lite_footer_hide_show', true)){ ?>
    <div class="footerinner py-4">
      <div class="container">
        <div class="row">
          <!-- Footer 1 -->
          <div class="<?php echo esc_attr($food_truck_lite_cols); ?> footer-block wow zoomIn">
              <?php if (is_active_sidebar('footer-1')) : ?>
                  <?php dynamic_sidebar('footer-1'); ?>
              <?php else : ?>
                  <aside id="categories" class="widget py-3" role="complementary" aria-label="<?php esc_attr_e('footer1', 'catering-lite'); ?>">
                      <h3 class="widget-title"><?php esc_html_e('Categories', 'catering-lite'); ?></h3>
                      <ul>
                          <?php wp_list_categories('title_li='); ?>
                      </ul>
                  </aside>
              <?php endif; ?>
          </div>
          <!-- Footer 2 -->
          <div class="<?php echo esc_attr($food_truck_lite_cols); ?> footer-block wow zoomIn">
              <?php if (is_active_sidebar('footer-2')) : ?>
                  <?php dynamic_sidebar('footer-2'); ?>
              <?php else : ?>
                  <aside id="archives" class="widget py-3" role="complementary" aria-label="<?php esc_attr_e('footer2', 'catering-lite'); ?>">
                      <h3 class="widget-title"><?php esc_html_e('Archives', 'catering-lite'); ?></h3>
                      <ul>
                          <?php wp_get_archives(array('type' => 'monthly')); ?>
                      </ul>
                  </aside>
              <?php endif; ?>
          </div>
          <!-- Footer 3 -->
          <div class="<?php echo esc_attr($food_truck_lite_cols); ?> footer-block wow zoomIn">
              <?php if (is_active_sidebar('footer-3')) : ?>
                  <?php dynamic_sidebar('footer-3'); ?>
              <?php else : ?>
                  <aside id="meta" class="widget py-3" role="complementary" aria-label="<?php esc_attr_e('footer3', 'catering-lite'); ?>">
                      <h3 class="widget-title"><?php esc_html_e('Meta', 'catering-lite'); ?></h3>
                      <ul>
                          <?php wp_register(); ?>
                          <li><?php wp_loginout(); ?></li>
                          <?php wp_meta(); ?>
                      </ul>
                  </aside>
              <?php endif; ?>
          </div>
          <!-- Footer 4 -->
          <div class="<?php echo esc_attr($food_truck_lite_cols); ?> footer-block  wow zoomIn">
            <?php if (is_active_sidebar('footer-4')) : ?>
                <?php dynamic_sidebar('footer-4'); ?>
            <?php else : ?>
                <aside id="search-widget" class="widget py-3" role="complementary" aria-label="<?php esc_attr_e('footer4', 'catering-lite'); ?>">
                    <h3 class="widget-title"><?php esc_html_e('Search', 'catering-lite'); ?></h3>
                    <?php the_widget('WP_Widget_Search'); ?>
                </aside>
            <?php endif; ?>
          </div>
        </div>
      </div>
    </div>
  <?php } ?>  
   <div class="footer <?php if( get_theme_mod( 'food_truck_lite_copyright_sticky', false) == 1) { ?> copyright-sticky<?php } else { ?>close-sticky <?php } ?>">  
  <?php if (get_theme_mod('food_truck_lite_copyright_hide_show', true)) {?>
    <div class="inner">
      <div class="container">
        <div class="copyright">
          <p class="m-0"><?php catering_lite_credit_link(); ?> <?php echo esc_html(get_theme_mod('food_truck_lite_text',__('By Themesglance','catering-lite'))); ?></p>
          <?php if(get_theme_mod('food_truck_lite_footer_social_media_hide_show',false)){ ?>
          <div class="mt-2">
            <?php if ( get_theme_mod('food_truck_lite_footer_facebook_link','') != "" ) {?>
                <a target="_blank" href="<?php echo esc_attr( get_theme_mod('food_truck_lite_footer_facebook_link','' )); ?>"><i class="<?php echo esc_html(get_theme_mod('food_truck_lite_footer_facebook_icon','fab fa-facebook-f')); ?>"></i><span class="screen-reader-text"><?php echo esc_html('Facebook', 'catering-lite'); ?></span></a>
            <?php }?>
            <?php if ( get_theme_mod('food_truck_lite_footer_twitter_link','') != "" ) {?>
                <a target="_blank" href="<?php echo esc_attr( get_theme_mod('food_truck_lite_footer_twitter_link','' )); ?>"><i class="<?php echo esc_html(get_theme_mod('food_truck_lite_footer_twitter_icon','fab fa-twitter')); ?>"></i><span class="screen-reader-text"><?php echo esc_html('Twitter', 'catering-lite'); ?></span></a>
            <?php }?>
            <?php if ( get_theme_mod('food_truck_lite_footer_linkdin_link','') != "" ) {?>
                <a target="_blank" href="<?php echo esc_attr( get_theme_mod('food_truck_lite_footer_linkdin_link','' )); ?>"><i class="<?php echo esc_html(get_theme_mod('food_truck_lite_footer_linkdin_icon','fab fa-linkedin-in')); ?>"></i><span class="screen-reader-text"><?php echo esc_html('Linkdin', 'catering-lite'); ?></span></a>
            <?php }?>   
            <?php if ( get_theme_mod('food_truck_lite_footer_instagram_link','') != "" ) {?>
                <a target="_blank" href="<?php echo esc_attr( get_theme_mod('food_truck_lite_footer_instagram_link','' )); ?>"><i class="<?php echo esc_html(get_theme_mod('food_truck_lite_footer_insta_icon','fab fa-instagram')); ?>"></i><span class="screen-reader-text"><?php echo esc_html('Instagram', 'catering-lite'); ?></span></a>
            <?php }?>   
            <?php if ( get_theme_mod('food_truck_lite_footer_pintrest_link','') != "" ) {?>
                <a target="_blank" href="<?php echo esc_attr( get_theme_mod('food_truck_lite_footer_pintrest_link','' )); ?>"><i class="<?php echo esc_html(get_theme_mod('food_truck_lite_footer_pinterest_icon','fab fa-pinterest')); ?>"></i><span class="screen-reader-text"><?php echo esc_html('Pintrest', 'catering-lite'); ?></span></a>
            <?php }?>                
          </div> 
          <?php } ?> 
        </div>
      </div>
    </div>
  <?php }?>
  </div>   
</footer>
  <?php if (get_theme_mod('food_truck_lite_enable_custom_cursor', false) != false) : ?>
  <!-- Custom cursor -->
  <div class="custom-cursor"></div>
  <!-- .Custom cursor -->
<?php endif; ?>
<?php wp_footer(); ?>
</body>
</html>