<?php $relic_options = get_option('relic_theme_options'); ?>
<footer class="main_footer">
  <?php if (is_active_sidebar('footer-1') || is_active_sidebar('footer-2') || is_active_sidebar('footer-3') || is_active_sidebar('footer-4')) { ?>
    <div class="top_footer">
      <div class="container webpage-container">
        <div class="row">				      
          <?php if (is_active_sidebar('footer-1')) { ?>
            <aside class="col-md-3 col-sm-6"> 
              <?php dynamic_sidebar('footer-1'); ?>
            </aside>
          <?php } ?>
          <?php if (is_active_sidebar('footer-2')) { ?>
            <aside class="col-md-3 col-sm-6"> 
              <?php dynamic_sidebar('footer-2'); ?>
            </aside>
          <?php } ?>
          <?php if (is_active_sidebar('footer-3')) { ?>
            <aside class="col-md-3 col-sm-6"> 
              <?php dynamic_sidebar('footer-3'); ?>
            </aside>
			<?php } ?>
			
          <?php if (is_active_sidebar('footer-4')) { ?>
            <aside class="col-md-3 col-sm-6"> 
              <?php dynamic_sidebar('footer-4'); ?>
            </aside>
          <?php } ?>	
        </div>      
      </div>
    </div>
  <?php } ?>
  <div class="bottom-footer">
    <div class="container webpage-container">
      <p>
        <?php if (get_theme_mod ( 'copyright_url_setting',$relic_options['footertext'])!='') {
               echo esc_attr(get_theme_mod ( 'copyright_url_setting',$relic_options['footertext'])) . '. ';
        }
        printf(/* translators: 1 is theme info*/esc_html__('Powered by %1$s', 'relic'),'<a href="'.esc_url("https://fruitthemes.com/wordpress-themes/relic").'" target="_blank">'.esc_html__("Relic WordPress Theme",'relic').'</a>'); ?>
      </p>
      <div class="terms">
        <?php
        if (has_nav_menu('footer')) {          
          wp_nav_menu(array(
              'theme_location' => 'footer',
              'echo' => true,
              'items_wrap' => '<ul id="%1$s" class="%2$s footer-menu">%3$s</ul>',
              'depth' => 1
          ));
        }
        ?> 				
      </div>
    </div>
  </div>
</footer>
<?php wp_footer(); ?>        
</body>
</html>