Field type: Taxonomy select
-
Hi,
I′d like to use the taxonomy select field with a custom post type “expose” with the taxonomy “object”.
I can choose the taxonomy in backend, but can’t echo the value in my template.
functions.php
... $cmb->add_field( array( 'name' => __( 'Objektart', 'cmb2' ), 'id' => $prefix . 'expose_objektbeschreibung_objektarten', 'taxonomy' => 'objektarten', 'type' => 'taxonomy_select', 'row_classes' => 'col-md-3', ) );
Template
<?php $expose_objektbeschreibung_objektarten = get_post_meta( get_the_ID(), '_cmb_expose_objektbeschreibung_objektarten', true ); echo $expose_objektbeschreibung_objektarten; ?>
Thanks for your help.
Ingo
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Field type: Taxonomy select’ is closed to new replies.