Cannot get custom fields to display on a taxonomy page

Support General Cannot get custom fields to display on a taxonomy page

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #13821
    ToomasToomas
    Participant

    Hello,

    I have created a taxonomy called "authors" with the MB Custom Taxonomy plugin and added terms "Agathe Christie" and "Mark Twain". Then with the MB Builder I created some custom fields (country, age) for the authors taxonomy. Then with the help of the MB Term Meta plugin I made those custom fields to appear in the taxonomy term (Agathe Christie and Mark Twain) edit screen. I also created a file "taxonomy-authors.php" in my theme's root. Now the question is how can I display those custom fields values (country and age) on this taxonomy page? I tried all the methods in the documentation (rwbm_meta, rwbm_get_field etc) but cannot display any data:

    $term_id = get_queried_object_id();
    $value = rwmb_meta( $field_id, array( 'object_type' => 'term' ), $term_id );
    echo $value;

    Kind regards,
    Toomas

    #13856
    Anh TranAnh Tran
    Keymaster

    Hi Toomas,

    Can you var_dump( $term_id ) to see if that's the correct ID of the current term?

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