I want to create a link for each term in a custom Wordpress taxonomy.
I don't get why this isn't working. A var_dump($artwork_media)
returns the full array but putting var_dump($artwork_medium)
within the foreach loop returns only the first item. Also the HTML doesn't get outputted at all.
<?php $artwork_media = get_terms( 'artwork_media' , array('taxonomy' => 'artwork_media', 'hide_empty' => 0) ); ?>
<div class="link-block">
<ul class="artwork-list row">
<?php foreach( $artwork_media as $artwork_medium ): ?>
<a href="/artwork/<?php echo $artwork_medium['slug']; ?>/" class="span3"><li><?php echo $artwork_medium['name']; ?></li></a>
<?php endforeach; ?>
</ul>
</div>
Any help is appreciated, thanks.