 <!-- Begin Footer -->
<footer>
<?php if ( 'option2' == get_theme_mod( 'alinan_wp_display_random_slider' ) ) {  ?>
<!-- Begin random Articles -->
<div id="random-slider-wrap">
<ul class="random-slider">
    <?php $alinan_wp_randomposts = new WP_Query(array('orderby' => 'rand', 'ignore_sticky_posts' => 1, 'posts_per_page' => esc_attr(8) )); ?>
    <?php while ($alinan_wp_randomposts->have_posts()) : $alinan_wp_randomposts->the_post(); ?> 

        <li class="img-zoom-in">
            <?php if ( has_post_thumbnail()) { ?>
                <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('alinan-wp-thumbnail-blog-articles', array('title' => "")); ?></a>
            <?php } else { ?>             
                <a href="<?php the_permalink(); ?>"> <img src="<?php echo get_template_directory_uri(); ?>/images/no-photo-321.png" alt="<?php esc_attr( 'Article image', 'alinan-wp' ); ?>" /></a>
            <?php } ?>

            <div class="inner-small">
                <div class="inner-cell">
                <!-- Category --><div class="article-category"><?php $alian_wp_category = get_the_category(); if ($alian_wp_category) { echo wp_kses_post('<a href="' . get_category_link( $alian_wp_category[0]->term_id ) . '">' . $alian_wp_category[0]->name.'</a> ');}  ?></div><!-- end .article-category -->                           
                <!-- Title --><a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a> <div class="clear"></div>
                <!-- Date --><div class="alinan-date"><i class="fas fa-clock"></i> <?php echo get_the_date(); ?></div><div class="clear"></div>
                </div><!-- end .inner-cell --> 
            </div><!-- end .inner-small -->
        </li><!-- end .item -->

    <?php endwhile; 
    /* Restore original Post Data */
    wp_reset_postdata(); ?>
</ul><!-- end #random-slider -->
</div><!-- end #random-slider-wrap -->
<div class="wrap-border-bottom"></div>
<div class="clear"></div>
<?php } ?>


    <?php if ( 'option2' == get_theme_mod( 'alinan_wp_footer_display_content' ) ) {  ?>
    <div class="footer-content">
        <?php echo wp_kses_post(stripslashes(get_theme_mod('alinan_wp_footer_content'))); ?>
    </div><!-- end .footer-content -->
    <?php } ?>


    <?php if ( 'option2' == get_theme_mod( 'alinan_wp_footer_display_widgets' ) ) {  ?>
    <div class="wrap-middle">
        <div class="one_fourth">
            <?php if ( is_active_sidebar( 'footer1_alinan_wp' ) ) { ?> <?php dynamic_sidebar( 'footer1_alinan_wp' ); ?> <?php } ?> 
        </div>
        <div class="one_fourth">
            <?php if ( is_active_sidebar( 'footer2_alinan_wp' ) ) { ?> <?php dynamic_sidebar( 'footer2_alinan_wp' ); ?> <?php } ?> 
        </div>
        <div class="one_fourth">
            <?php if ( is_active_sidebar( 'footer3_alinan_wp' ) ) { ?> <?php dynamic_sidebar( 'footer3_alinan_wp' ); ?> <?php } ?> 
        </div>
        <div class="one_fourth_last">
            <?php if ( is_active_sidebar( 'footer4_alinan_wp' ) ) { ?> <?php dynamic_sidebar( 'footer4_alinan_wp' ); ?> <?php } ?> 
        </div><div class="clear"></div>    
    </div><!-- end .wrap-middle -->
    <?php } ?>


    <div class="footer-copyright">
        <?php echo wp_kses_post(stripslashes(get_theme_mod('alinan_wp_copyright', '2018 &copy; Alinan, Inc. All Rights Reserved.'))); ?>
    </div><!-- end .footer-copyright -->      

    <!-- Go to TOP -->
    <p id="back-top"><a href="#top">
      <span><i class="fas fa-chevron-up"></i></span></a>
    </p><!-- end #back-top -->
</footer><!-- end #footer -->

<!-- Footer Theme output -->
<?php wp_footer();?>
</body>
</html>