I have a posttype called store which has fields called title by default and custom field called storeurl. This posttype websites is made as taxonomy for the posttype books using CPT onomies, where store is displayed as checkboxes. What I am trying to do is display the book and based on the store selected in the checkbox the corresponding url of the store where its available, but though I am able to get the store name i am unable to retrieve the storeurl. <div class="collection"> <div class="storename"> <?php echo strip_tags(get_the_term_list( $post->ID, 'stores')); ?> </div> <div class="click"> <a href=<?php strip_tags(get_term_field( 'storeurl',$post->ID, 'stores'))?>> BUY</a> </div> </div>
Just an idea! Why you don't use directly : <?php get_post_type_archive_link( stores ); ?> More information can be found here : Link