8
I've created custom taxonomies on WordPress and I want to display the current post taxonomies on the post in a list.
I'm using the following code to display a custom taxonomy named "Job Discipline":
<ul>
<?php $args = array('taxonomy' => 'job_discipline'); ?>
<?php $tax_menu_items = get_categories( $args );
foreach ( $tax_menu_items as $tax_menu_item ):?>
<li>
Job Discipline: <a href="<?php echo get_term_link($tax_menu_item,$tax_menu_item->taxonomy); ?>">
<?php echo $tax_menu_item->name; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
That's just one of many taxonomies I want to list.
The problem is that the above code is displaying all the "Job Disciplines" which have at least one post and not the current post taxonomy.
How can I sort out this issue?