updated the cpt and others

This commit is contained in:
2026-02-01 14:06:09 +01:00
parent 7b94f3cf64
commit 49bd340a93
5 changed files with 27 additions and 10 deletions

View File

@@ -73,12 +73,24 @@ class Partnerexpo_Core_Public {
$posts = [];
foreach ($query->posts as $post) {
$terms = wp_get_post_terms($post->ID, 'taxidermy_tags', ['fields' => 'all']);
$my_term = null;
foreach ($terms as $term) {
if ($term->slug === 'tags') {
$my_term = $term->name; // or ->term_id
break;
}
}
$posts[] = [
'id' => $post->ID,
'title' => $post->post_title,
'image' => get_the_post_thumbnail_url($post->ID),
'excerpt' => $post->post_excerpt,
'modif' => $post->post_modified,
'date' => date('Y-m-d', strtotime($post->post_date)),
'tag' => $my_term ?? null,
'url' => get_permalink($post),
];
}