-
-
Save jbreitenbucher/1543014 to your computer and use it in GitHub Desktop.
$styles = get_post_meta($post->ID, 'it_classroom_style_taxonomy',true) ; | |
echo $styles[0]; | |
$style = get_term_by( 'id', $styles[0], 'style' );//get_term($styles[0], 'style'); | |
print_r($style); | |
echo $style->name; |
This taxonomy returns the correct name
register_taxonomy(
'building',
'itclassroom',
array(
'hierarchical' => false,
'labels' => $labels_building,
'query_var' => true,
'rewrite' => array( 'slug' => 'buildings', 'with_front' => false ),
)
);
and this one is not
register_taxonomy(
'style',
'itclassroom',
array(
'hierarchical' => false,
'labels' => $labels_classroom,
'query_var' => true,
'rewrite' => array( 'slug' => 'classroom-styles', 'with_front' => false ),
)
);
The metaboxes are generated with
array(
'name' => 'Building',
'desc' => '',
'id' => $prefix . 'building_taxonomy',
'taxonomy' => 'building', //Enter Taxonomy Slug
'type' => 'taxonomy_radio',
),
and
array(
'name' => 'Classroom Style',
'desc' => '',
'id' => $prefix . 'classroom_style_taxonomy',
'taxonomy' => 'style', //Enter Taxonomy Slug
'type' => 'taxonomy_multicheck',
),
the_meta() shows it_classroom_style_taxonomy: a:1:{i:0;s:2:"97";}