To start with I'm pretty new with php so any nice kind person who agrees to help me, please be gentle.
What I want is generate a list of taxonomy terms that are associated with a specific post id. I want to list them on a page using a shortcode. I pulled the code from the loop which does almost the same thing, but apparently it doesn't work outside of the loop and any attempts to adapt it have only succeed in generating errors. Google this far has not been particularly helpful. I'm sure the solution is extremely simple, but it escapes me. Any input would be appreciated.
<?php if(has_term('', 'themes')): ?>
<span class="title">Themes</span>
<p><?php echo get_the_term_list( $post->id, 'themes', ' ', ', ') ?></p>
<?php endif; ?>