feat(topics): restore topic taxonomy workflow

This commit is contained in:
kate522 committed 2026-11-10 22:31:11 +08:00
1 parent f3dd1ec3b1
commit a254cbd3e9
59 files changed
+771 -192

No files matched your search

+9 -2
View File
@@ -220,7 +220,7 @@ endif;
if (!function_exists('jio_get_single_article_tags_html')) :
/**
* Categories → tags.
* Categories, topics and tags.
*/
function jio_get_single_article_tags_html(int $post_id): string {
$cats = get_the_category($post_id) ?: [];
@@ -230,6 +230,13 @@ if (!function_exists('jio_get_single_article_tags_html')) :
'<i class="fa fas fa-folder-open" aria-hidden="true"></i> ',
['c-blue', 'c-yellow', 'c-green', 'c-purple', 'c-red']
);
$topics = get_the_terms($post_id, 'topics');
$topic_html = is_array($topics) ? jio_get_colored_term_tags(
$topics,
'but ml6 radius',
'<i class="fa fas fa-cube" aria-hidden="true"></i> ',
['c-blue', 'c-yellow', 'c-green', 'c-purple', 'c-red']
) : '';
$tags_html = '';
$tags = get_the_tags($post_id) ?: [];
@@ -246,7 +253,7 @@ if (!function_exists('jio_get_single_article_tags_html')) :
}
}
$top = $cat_html;
$top = $cat_html . $topic_html;
if ($top === '' && $tags_html === '') {
return '';
}