I have added custom taxonomy fields on tags but when I use get_tags()
it does not return custom field. Right now I am using get_term_meta()
for custom field but I have 4000 records of tags so when I fire the query to get tags it fires 4000 queries so any way to minimize it or get results in 1 query with get_tags()
.
I have added custom taxonomy fields on tags but when I use get_tags()
it does not return custom field. Right now I am using get_term_meta()
for custom field but I have 4000 records of tags so when I fire the query to get tags it fires 4000 queries so any way to minimize it or get results in 1 query with get_tags()
.
Have you try
$tags = wp_get_post_tags($post->ID);
?
<?php foreach($tags as $tag): ?>
<span class="tag-element">
<?=$tag->name ?>,
</span>
<?php endforeach; ?>