• Resolved dessainsaraiva

    (@dessainsaraiva)


    Hey, I am trying to list the categories chosen by the user but no success so far.
    On functions.php I have:
    (…)
    $cmb->add_field( array(
    ‘name’ => ‘Test Taxonomy Multicheck’,
    ‘id’ => $prefix . ‘categories’,
    ‘taxonomy’ => ‘category’,
    ‘type’ => ‘taxonomy_multicheck’,
    ) );
    (…)

    On the page template I have:
    (…)
    $categories = get_term_meta( get_the_ID(), ‘_blog_categories’, true );
    echo $categories;
    (…)

    This works fine for a field text I have however it’s not working to retrieve the categories. Can someone help me out ?

    Thanks,

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Get categories’ is closed to new replies.