Using WordPress portfolio tags and types in a theme

I’ve been using the WordPress portfolio feature on my blog and website, but it turns out that portfolio tags are dealt with differently from post tags, as they are part of a custom content type with their own taxonomy.  I searched around for the theme code to insert a tag list but the best I could find was this post (which obviously worked at some point), but a bit of database examination showed that the name of the taxonomy must have changed since this post was written, and they are now named jetpack-portfolio-tag (and jetpack-portfolio-type for the type).

Therefore the code to insert a list of WordPress portfolio tags into a theme is:

<?php the_terms(get_the_ID(), 'jetpack-portfolio-tag', $before, $separator, $after); ?>

using the optional $before, $separator and $after parameters to taste.

Leave a Reply

Your email address will not be published. Required fields are marked *