File: /var/www/panigaletech.com/wp-content/themes/panigale/template-parts/news.php
<?php
/**
* Template Name: News Page
*
* @package WordPress
* @subpackage Twenty_Fourteen
* @since Twenty Fourteen 1.0
*/
get_header();
?>
<!--FInd Talent-->
<section class="inner-section mb-3">
<div class="container-fluid">
<div class="row">
<?php while ( have_posts() ) : the_post(); ?>
<div class="col-lg-8 col-md-10 col-sm-12 offset-lg-2 offset-md-1 text-center">
<h2 class="heading02 font-weight-7 mb-2 wow fadeInUp" data-wow-duration="2s"><?php the_title(); ?></h2>
<p class=" wow fadeInUp" data-wow-duration="2s"><?php the_content(); ?></p>
</div>
<?php endwhile; ?>
<div class="col-lg-10 offset-lg-1 mt-5">
<?php
$footerNewsLists = get_posts(array('post_type'=>'news','post_status'=>'publish',
'orderby'=> 'date', 'order' => 'DESC','posts_per_page'=> 19000));
// echo "<pre>";
// print_r($footerNewsLists);
// echo "</pre>";
if(!empty($footerNewsLists )){
?>
<div class="row">
<?php foreach($footerNewsLists as $keynews=>$valnews){
$image_url = wp_get_attachment_image_src( get_post_thumbnail_id($valnews->ID), 'full'); ?>
<div class="col-lg-12">
<div class="news-post news-list">
<div class="post-thumb">
<a href="#"><img class="img-fulid" src="<?php echo $image_url[0];?>" alt="<?php echo $valnews->post_title; ?>"></a>
<div class="hover-wrap">
</div>
</div>
<div class="post-content">
<h3 class="heading03 text-blue post-title mb-2 wow fadeInUp" data-wow-duration="2s"><a href="<?php echo get_permalink( $valnews->ID ); ?>"> <?php echo $valnews->post_title; ?></a>
</h3>
<div class="meta wow fadeInUp" data-wow-duration="2s">
<span class="meta-part"><i class="fas fa-user"></i> By <?php the_author_meta( 'display_name', $valnews->post_author ); ?></span>
<span class="meta-part"><i class="far fa-calendar-alt"></i> <?php echo get_field( "news_date", $valnews->ID ); ?></span>
</div>
<p class="news-list-text-limited wow fadeInUp" data-wow-duration="2s"><?php echo string_part($valnews->post_content, 350); ?></p>
<a href="<?php echo get_permalink( $valnews->ID ); ?>" class="btn btn-blue wow fadeInUp" data-wow-duration="2s">Read More</a>
</div>
</div>
</div>
<?php } ?>
<?php include 'footer-upper-content.php';?>
</div>
<?php } else { ?>
<div class="row">
<div class="col-lg-12">
<p>No news found</p>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</section>
<!--FInd Talent-->
<?php
get_footer();
?>