updating news_type taxonomy to be better handled by javascript
This commit is contained in:
parent
1905ffa495
commit
2adb2be068
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ $relatedPageTemplatePage = get_pages($args) ? get_pages($args)[0] : null;
|
|||
---------------*/ ?>
|
||||
<?php
|
||||
get_template_part("template-components/news-heading-box", null, array(
|
||||
"news_type" => 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()
|
||||
|
|
|
|||
|
|
@ -44,8 +44,8 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
|
|||
<ul class="filters-toolbar filters-toolbar--archive-news">
|
||||
<?php
|
||||
$news_types = get_terms(array(
|
||||
'taxonomy' => 'news-type',
|
||||
'hide_empty' => true,
|
||||
'taxonomy' => 'news_type',
|
||||
'hide_empty' => false,
|
||||
));
|
||||
|
||||
?>
|
||||
|
|
@ -55,7 +55,7 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
|
|||
<?php foreach ($news_types as $typeTerm) : ?>
|
||||
<?php
|
||||
|
||||
$termIcon = get_field('news_type_icon', "news-type" . '_' . $typeTerm->term_id) ?? null;
|
||||
$termIcon = get_field('news_type_icon', "news_type" . '_' . $typeTerm->term_id) ?? null;
|
||||
|
||||
?>
|
||||
<li>
|
||||
|
|
@ -93,7 +93,7 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
|
|||
<?php
|
||||
foreach ($posts->posts 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',
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user