Term Meta values not outputting properly?

Support MB Term Meta Term Meta values not outputting properly?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #42818
    Alan BlairAlan Blair
    Participant

    I have a Taxonomy Meta field on "Categories" called "Category Color Primary" which is a Color Picker. It has the ID 'category_color_primary'

    I'm trying to use this on a Post Single template with Bricks Builder. But I'm getting an empty value.

    I have tried the generated Bricks token {mb_category_category_color_primary} and PHP rwmb_meta( 'category_color_primary', [ 'object_type' => 'term' ], get_queried_object_id() ); - Both ouput an empty value.

    I suspect it is because the current get_queried_object_id() is the Post ID.

    So if the Post has only one category I could use:

    rwmb_meta( 'category_color_primary', [ 'object_type' => 'term' ], get_the_category()[0]->term_id);

    Ideally, the token {mb_category_category_color_primary} would do this automatically.

    So am I on the right track, or am I missing something here?

    #42821
    PeterPeter
    Moderator

    Hello,

    I think you have the same issue on this topic https://support.metabox.io/topic/custom-field-color-picker-on-category-dd-says-empty-but-its-not/

    You should pass the term ID to the third parameter of the helper function rwmb_meta() to get the term meta value. If you use the Bricks builder to output the value and it does not work, please contact Bricks support to get more information.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.