I have a custom Page Template, and this is the code that I am trying to manipulate to change depending on a custom meta value that I write for specific Pages.
$terms = get_the_terms($post->id, 'custom-taxonomy' );
On the Page CPT, I have a custom meta field “Taxonomy Name”, and the custom meta value is “Custom Taxonomy”
What I am trying to do with the code above is:
$terms = get_the_terms($post->id, get_post_meta($post->ID,'metafield-taxonomy-name',TRUE) );
Obviously (through actually trying it ;)), that snippet doesn’t work since the meta value is not passing through in quotes.
Is there a way I can achieve this, so that ‘get_the_terms’ can be changed dynamically depending on the meta value that I give it?
Thanks!
Roc.
Seemed have found a solution via customizing a code snippet from here:
http://wordpress.org/support/topic/get_the_terms-using-array-of-taxonomies
Thanks!