Is it possible to hide taxonomies without categories. I’m using get_object_taxonomies to show all my taxonomies inside my custom post type.
<?php
$blog_taxonomies = get_object_taxonomies( 'blog', 'textdomain',
(array(
'hide_empty' => true,
))
);
foreach ($blog_taxonomies as $blog_taxonomy) :
?>
<ul class="blog__categories-list">
<li class="blog__categories-title"> <?= $blog_taxonomy->labels->name; ?> </li>
<?php endforeach; ?>
2
Answers
You can use the code below. The parameters you submitted to get_object_taxonomies are incorrect.
See get_object_taxonomies documentation.
use
get_object_taxonomies
function like this