I have 2 custom post types with custom taxonomies, and want to show the taxonomies as part of the excerpt so I cobbled together a new function. It works if I just echo the term list for one post type, but I want to have an if else... here's the section I am not sure will work.
<div class="entry-meta">
<?php get_post_type( $post ) if ($post =='real_estate'){ ?>
<?php echo get_the_term_list( $post->ID, 'rdc_price', 'Price: ', ', ', '' ); ?>
<?php echo get_the_term_list( $post->ID, 'rdc_contract', 'Contract: ', ', ', '' ); ?>
<?php echo get_the_term_list( $post->ID, 'rdc_purpose', 'Property Use: ', ', ', '' ); ?>
<?php echo get_the_term_list( $post->ID, 'rdc_size', 'Size: ', ', ', '' ); ?>
<?php }elseif ($post =='merchants') {?>
<?php echo get_the_term_list( $post->ID, 'merchant_address1', '', ', ', '' ); ?>
<?php echo get_the_term_list( $post->ID, 'merchant_address2', '', ', ', '' ); ?>
Ronceverte, WV 24970
<?php echo get_the_term_list( $post->ID, 'merchant_telephone', 'Phone: ', ', ', '' ); ?>< >< >
<?php echo get_the_term_list( $post->ID, 'merchant_fax', 'Fax: ', ', ', '' ); ?>
<?php echo get_the_term_list( $post->ID, 'merchant_email', 'Email: ', ', ', '' ); ?>
<?php }
?>
</div>
Help is really welcome!