4,
'post_type' => 'post',
'orderby' => 'post_date',
'order' => 'DESC',
'post_status' => 'publish' // Show only the published posts
);
$recentNewsPosts = new WP_Query($args);
// echo '
';
// print_r($recentNewsPosts);
// echo '
';
?>
have_posts()) : while ($recentNewsPosts->have_posts()) : $recentNewsPosts->the_post(); ?>
ID, 'full', array('class' => 'card-news__thumbnail'));
$news_type = get_the_terms($post->ID, "news_type") ?? null;
get_template_part(
'template-components/cards/card-news',
null,
array(
'card_variant' => 'activite',
'post_ID' => $post->ID,
'post_title' => get_the_title(),
'post_thumbnail' => $post_thumbnail,
'news_type' => $news_type,
'post_date' => $post_date,
)
);
?>
'_wp_page_template',
'meta_value' => "template-archive-news.php"
);
$relatedPageTemplatePage = get_pages($args) ? get_pages($args)[0] : null;
?>