I am trying to get current post custom taxonomy link and name separately to put some schema data and my code is:
<?php $args = array('taxonomy' => 'developer'); ?>
<?php $tax_menu_items = get_categories( $args );
foreach ( $tax_menu_items as $tax_menu_item ):?>
<meta itemprop="url" content="<?php echo get_term_link($tax_menu_item,$tax_menu_item->taxonomy); ?>"></meta>
<a href="<?php echo get_term_link($tax_menu_item,$tax_menu_item->taxonomy); ?>">
<span itemprop="name"><?php echo $tax_menu_item->name; ?></span></a>
<?php endforeach; ?>
</div>`
The problem is that the above code is displaying all the "developer" which have at least one post and not the current post taxonomy.
How can I fix this!