It’s hard to be sure without knowing what Taxonomy the “Portfolio” post type is using. Even though it’s a different post type, it might still be using the default category taxonomy. If it is, then you don’t need to use get_categories();
as you’re doing above. The following should work:
<?php get_the_category_list('|'); ?>
The reason your code doesn’t work is because 'your_custom_taxonomy'
isn’t a valid taxonomy. You can always turn on debugging in WordPress to show you any errors that are popping up, instead of just seeing a blank page.
For more info, see get_the_category_list and get_categories.
If you’re trying to display only the terms that are applied to a given post (not all of the categories available), for a taxonomy portfolio_category
, try the following:
<?php echo get_the_term_list( $post->ID, 'portfolio_category' ); ?>
See: http://codex.wordpress.org/Function_Reference/get_the_term_list