File: /var/www/dev.captainschairit.com/wp-content/themes/captainschare/template-parts/press-center.php
<?php
/**
* Template Name: Press Center
*/
get_header();
$banner_section = get_field('banner_section');
?>
<!-- Header -->
<header class="masthead-inner" style="background-image: url(<?php echo $banner_section['background_image'] ?>)">
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-8 offset-lg-2">
<div class="intro-text text-center">
<div class="intro-heading"><?php echo $banner_section['text'] ?></div>
</div>
</div>
</div>
</div>
</header>
<!-- Services -->
<section class="page-section pb-0" id="clientDashboard">
<div class="container">
<div class="row">
<div class="col-lg-10 offset-lg-1 text-center">
<!-- <h2 class="heading01 mb-5"><?php //echo get_the_title(); ?></h2> -->
</div>
</div>
</div>
</section>
<!-- Services -->
<?php
$args = array(
'posts_per_page' => -1,
'orderby' => 'date',
'order' => 'ASC',
'post_type' => 'cc-news',
'post_status' => 'publish',
);
$all_news = get_posts( $args );
// echo '<pre>'; print_r ($all_news); echo '</pre>'; ?>
<section class="page-section news-section news-slider">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="responsive slider">
<?php foreach($all_news as $news) {
$featured_img_url = get_the_post_thumbnail_url($news->ID,'full');
// $author_name = get_field( "author_name", $news->ID ); ?>
<div>
<div class="card news-card card-width ">
<a href="<?php echo get_permalink($news->ID); ?>" class="no-barba link-wrapper" target="_blank" rel="noopener noreferrer" tabindex="-1"></a>
<div class="news-logo">
<img src="<?php echo $featured_img_url; ?>" alt="<?php echo $news->post_title; ?>">
</div>
<h4 class="color-midnight"><?php echo $news->post_title; ?></h4>
<p class="date uppercase color-gray-medium">on <?php echo get_the_date('M d, Y g:i A', $news->ID); ?></p>
<p class="description color-gray-dark hidden-sm-down">
<?php echo substr($news->post_content, 0, 180); ?>
</p>
</div>
</div>
<?php
} ?>
</div>
</div>
</div>
</div>
<?php
$args = array(
'posts_per_page' => -1,
'orderby' => 'date',
'order' => 'ASC',
'post_type' => 'cc-press-releases',
'post_status' => 'publish',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'featured',
'value' => 'featured',
'compare' => 'like',
),
),
);
$press_releases = get_posts( $args );
// echo '<pre>'; print_r ($press_releases); echo '</pre>'; ?>
<div class="section-padding pb-0">
<div class="container">
<div class="row">
<div class="col-12">
<div class="row mb-2">
<div class="col-12">
<h2 class="heading02">Press Releases</h3>
</div>
</div>
<div class="row press-list pt-5 pb-2">
<?php foreach($press_releases as $press_release) { ?>
<div class="col-12 mb-5">
<p class="text-uppercase color-gray-medium"><b><?php echo get_the_date('M d, Y', $press_release->ID); ?></b></p>
<h3 class="heading03">
<a href="<?php echo get_permalink($press_release->ID); ?>"><?php echo $press_release->post_title; ?></a>
</h3>
</div>
<?php
} ?>
<div class="col-12 text-left">
<a href="<?php echo get_site_url(); ?>/all-press-releases/" class="btn btn-primary btn-rounded hvr-shutter-out-horizontal">See all</a>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<?php
get_footer();
?>