<?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 WordPress
 * @subpackage Twenty_Twenty_One
 * @since Twenty Twenty-One 1.0
 */

?>
	
  <!-- Footer -->
  <footer id="footer" class="footer" data-bg-img="<?php echo get_template_directory_uri()?>/myassets/images/footer-bg.png" data-bg-color="#25272e">
    <div class="container pt-70 pb-40">
      <div class="row border-bottom-black">
        <div class="col-sm-6 col-md-4">
          <div class="widget dark">
            <img class="mt-10 mb-20" alt="" src="<?php echo get_template_directory_uri()?>/myassets/images/logo-wide-white-footer.png">
            <p>203, Envato Labs, Behind Alis Steet, Melbourne, Australia.</p>
            <ul class="list-inline mt-5">
              <li class="m-0 pl-10 pr-10"> <i class="fa fa-phone text-theme-colored mr-5"></i> <a class="text-gray" href="#">123-456-789</a> </li>
              <li class="m-0 pl-10 pr-10"> <i class="fa fa-envelope-o text-theme-colored mr-5"></i> <a class="text-gray" href="#">contact@yourdomain.com</a> </li>
              <li class="m-0 pl-10 pr-10"> <i class="fa fa-globe text-theme-colored mr-5"></i> <a class="text-gray" href="#">www.yourdomain.com</a> </li>
            </ul>
            <ul class="social-icons icon-dark icon-theme-colored icon-circled icon-sm mt-15">
              <li><a href="#"><i class="fa fa-facebook"></i></a></li>
              <li><a href="#"><i class="fa fa-twitter"></i></a></li>
              <li><a href="#"><i class="fa fa-skype"></i></a></li>
              <li><a href="#"><i class="fa fa-youtube"></i></a></li>
              <li><a href="#"><i class="fa fa-instagram"></i></a></li>
              <li><a href="#"><i class="fa fa-pinterest"></i></a></li>
            </ul>
          </div>
        </div>
        <div class="col-sm-6 col-md-4">
          <div class="widget dark">
            <div class="widget-title line-bottom">Latest News</div>
            <div class="latest-posts">
				  <?php
					$blogs = array( 
					'category'		=> '',     // post_id of category  						     
					'showposts' 		=> 2,    
					'orderby' 		=> 'ASC'		
					);     
					$blogs1 = get_posts( $blogs ); 
					 $i=1;			
					foreach ($blogs1 as $post) : setup_postdata( $post ); 
					$feat_id = $post->ID;                                  
					$feat_title = $post->post_title;               
					$feat_content = $post->post_content;
					$author_id = $post->post_author ;
					$feat_content1 =wp_trim_words($feat_content, 50); 
					$blog_img = wp_get_attachment_url( get_post_thumbnail_id($feat_id), 'full' );
					$thumb_id = get_post_thumbnail_id(get_the_ID());
					$blog_alt = get_post_meta($thumb_id, '_wp_attachment_image_alt', true);

				 ?>			
              <article class="post media-post clearfix pb-0 mb-10">
                <img src="<?php echo $blog_img ; ?>" alt="<?php echo $blog_alt ; ?>">
                <div class="post-right">
                  <div class="post-title mt-0 mb-5"><a href="<?php echo get_permalink( $feat_id ); ?>"><?php echo $feat_title ; ?></a></div>
                  <p class="post-date mb-0 font-12"><?php echo $post_date = get_the_date( 'd M Y' );  ?></p>
                </div>
              </article>
			  <?php $i++; endforeach;  ?>
            </div>
          </div>
        </div>
        <div class="col-sm-6 col-md-4">
          <div class="widget dark">
            <div class="widget-title line-bottom">Useful Links</div>
				<?php			
					$defaults = array(
					'menu'            => 'main-menu',
					'menu_class'      => 'list angle-double-right list-border',
					'menu_id'         => '',
					'container'       => '',
					'echo'             => true,
					'fallback_cb'     => 'wp_page_menu',
					'items_wrap'      => '<ul id="%1$s" class="%2$s">%3$s</ul>',
					'depth'           => 0,
					'after'            => '',
					'walker'          => ''
					);	
					echo wp_nav_menu( $defaults );	
				?>
          </div>
        </div>
      </div>
    </div>
    <div class="footer-bottom bg-black-333">
      <div class="container pt-15 pb-10">
        <div class="row">
          <div class="col-md-6">
            <p class="font-11 text-black-777 m-0 sm-text-center">Copyright &copy;2023 myperthapp. All Rights Reserved</p>
          </div>
        </div>
      </div>
    </div>
  </footer>
  <a class="scrollToTop" href="#"><i class="fa fa-angle-up"></i></a>
</div>
<!-- end wrapper -->

<!-- Footer Scripts -->
<!-- JS | Custom script for all pages -->
<script src="<?php echo get_template_directory_uri()?>/myassets/js/custom.js"></script>

	
<?php wp_footer(); ?>

</body>
</html>
