diff --git a/blocks/communiques-presse-feed/build/render.php b/blocks/communiques-presse-feed/build/render.php index 5817207..2c784b6 100644 --- a/blocks/communiques-presse-feed/build/render.php +++ b/blocks/communiques-presse-feed/build/render.php @@ -29,15 +29,14 @@ $newsTemplatePage = get_pages($args) ? get_pages($args)[0] : null; posts as $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") ?? ""; $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( 'template-components/cards/card-news', null, array( - 'card_variant' => $news_type, + 'card_variant' => $news_type[0]->name, 'post_ID' => $post->ID, 'post_title' => get_the_title($post->ID), 'post_thumbnail' => $post_thumbnail, diff --git a/blocks/communiques-presse-feed/src/render.php b/blocks/communiques-presse-feed/src/render.php index 5817207..2c784b6 100644 --- a/blocks/communiques-presse-feed/src/render.php +++ b/blocks/communiques-presse-feed/src/render.php @@ -29,15 +29,14 @@ $newsTemplatePage = get_pages($args) ? get_pages($args)[0] : null; posts as $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") ?? ""; $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( 'template-components/cards/card-news', null, array( - 'card_variant' => $news_type, + 'card_variant' => $news_type[0]->name, 'post_ID' => $post->ID, 'post_title' => get_the_title($post->ID), 'post_thumbnail' => $post_thumbnail,