passing date to news card
This commit is contained in:
parent
a68d8ac6cf
commit
57cfc39633
File diff suppressed because one or more lines are too long
|
|
@ -31,6 +31,8 @@ $newsTemplatePage = get_pages($args) ? get_pages($args)[0] : null;
|
||||||
$post_thumbnail = get_the_post_thumbnail($post->ID, 'full', array('class' => 'card-news__thumbnail card-post__thumbnail')) ?? null;
|
$post_thumbnail = get_the_post_thumbnail($post->ID, 'full', array('class' => 'card-news__thumbnail card-post__thumbnail')) ?? null;
|
||||||
$news_type = get_the_terms($post->ID, "news_type") ?? null;
|
$news_type = get_the_terms($post->ID, "news_type") ?? null;
|
||||||
$thematique = get_the_terms($post->ID, "thematiques") ? get_the_terms($post->ID, "thematiques")[0] : null;
|
$thematique = get_the_terms($post->ID, "thematiques") ? get_the_terms($post->ID, "thematiques")[0] : null;
|
||||||
|
$post_date = get_the_date('j.m.Y', $post->ID) ?? null;
|
||||||
|
|
||||||
get_template_part(
|
get_template_part(
|
||||||
'template-components/cards/card-news',
|
'template-components/cards/card-news',
|
||||||
null,
|
null,
|
||||||
|
|
@ -40,6 +42,7 @@ $newsTemplatePage = get_pages($args) ? get_pages($args)[0] : null;
|
||||||
'post_title' => get_the_title($post->ID),
|
'post_title' => get_the_title($post->ID),
|
||||||
'post_thumbnail' => $post_thumbnail,
|
'post_thumbnail' => $post_thumbnail,
|
||||||
'thematique' => $thematique,
|
'thematique' => $thematique,
|
||||||
|
'post_date' => $post_date,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@ $newsTemplatePage = get_pages($args) ? get_pages($args)[0] : null;
|
||||||
$post_thumbnail = get_the_post_thumbnail($post->ID, 'full', array('class' => 'card-news__thumbnail card-post__thumbnail')) ?? null;
|
$post_thumbnail = get_the_post_thumbnail($post->ID, 'full', array('class' => 'card-news__thumbnail card-post__thumbnail')) ?? null;
|
||||||
$news_type = get_the_terms($post->ID, "news_type") ?? null;
|
$news_type = get_the_terms($post->ID, "news_type") ?? null;
|
||||||
$thematique = get_the_terms($post->ID, "thematiques") ? get_the_terms($post->ID, "thematiques")[0] : null;
|
$thematique = get_the_terms($post->ID, "thematiques") ? get_the_terms($post->ID, "thematiques")[0] : null;
|
||||||
|
$post_date = get_the_date('j.m.Y', $post->ID) ?? null;
|
||||||
|
|
||||||
get_template_part(
|
get_template_part(
|
||||||
'template-components/cards/card-news',
|
'template-components/cards/card-news',
|
||||||
null,
|
null,
|
||||||
|
|
@ -40,6 +42,7 @@ $newsTemplatePage = get_pages($args) ? get_pages($args)[0] : null;
|
||||||
'post_title' => get_the_title($post->ID),
|
'post_title' => get_the_title($post->ID),
|
||||||
'post_thumbnail' => $post_thumbnail,
|
'post_thumbnail' => $post_thumbnail,
|
||||||
'thematique' => $thematique,
|
'thematique' => $thematique,
|
||||||
|
'post_date' => $post_date,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user