diff --git a/includes/api.php b/includes/api.php index de6efc0..ca21817 100644 --- a/includes/api.php +++ b/includes/api.php @@ -107,7 +107,7 @@ function get_news_posts_per_type_id($request) "posts_per_page" => -1, "tax_query" => array( array( - 'taxonomy' => 'news-type', + 'taxonomy' => 'news_type', 'field' => 'term_id', 'terms' => $typeId ) @@ -133,8 +133,8 @@ function build_news_posts_feed_all($request) ob_start(); foreach ($newsPostsDatas as $key => $post) { $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; - write_log($news_type); + $news_type = get_the_terms($post->ID, "news_type") ?? null; + // write_log($news_type); get_template_part( 'template-components/cards/card-news', null, @@ -165,7 +165,7 @@ function build_news_posts_feed_per_type_id($request) "posts_per_page" => -1, "tax_query" => array( array( - 'taxonomy' => 'news-type', + 'taxonomy' => 'news_type', 'field' => 'term_id', 'terms' => $typeId ) @@ -177,7 +177,7 @@ function build_news_posts_feed_per_type_id($request) ob_start(); foreach ($newsPostsDatas as $key => $post) { $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; get_template_part( 'template-components/cards/card-news', null, diff --git a/single-post.php b/single-post.php index 41490dd..ae3e3c8 100644 --- a/single-post.php +++ b/single-post.php @@ -41,7 +41,7 @@ $relatedPageTemplatePage = get_pages($args) ? get_pages($args)[0] : null; ---------------*/ ?> get_the_terms(get_the_ID(), 'news-type'), + "news_type" => get_the_terms(get_the_ID(), 'news_type'), "title" => get_the_title(), "thumbnail" => get_the_post_thumbnail(get_the_ID(), "full", array('class' => 'news-heading-box__thumbnail')), "published" => get_the_date() diff --git a/template-archive-news.php b/template-archive-news.php index 7b1cbcb..ee63b97 100644 --- a/template-archive-news.php +++ b/template-archive-news.php @@ -44,8 +44,8 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;