web-profile

Taxonomy

Get all taxonomy terms (categories or tags) associated with the given object (or objects if array is given):

$tax_args = array(
	'orderby' => 'name',
	'order' => 'ASC',
	'fields' => 'all'
);
$categories = wp_get_object_terms($post->ID, 'catalog_category', $tax_args );
if ($categories) {
	foreach ($categories as $category) {
		echo ' <a href="'.get_term_link($category->slug, 'catalog_category').'">'.$category->name.'</a>';
	}
}

Leave a Reply

Your email address will not be published.