• Resolved duke78

    (@duke78)


    following situation:

    POD: forderung (custom post type)
    – field “intro” (plain text)
    – field “alter” (relationship to forderungsalter / dropdown)

    forderungsalter (custom taxonomy)
    – field f_alter

    now i want to show it this values in my template

    
    echo get_post_meta( $post->ID, 'intro', true )
    

    this works, but i cannot get the values of “alter”!

    
    echo get_post_meta( $post->ID, 'alter', true )
    

    doesnt work. Also..

    
    wp_get_post_terms( $post->ID, 'alter', array( "fields" => "all" ) );
    

    doesnt work because it is not a real taxonomy field!
    how can i get the value if the field “alter”

    thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hello @duke78

    It’s better to link taxonomies the regular WordPress way instead of using fields. You’ll see that it’s working then.

    If you absolutely require fields for the taxonomy relationship you can use get_post_meta to get the relationships.

    Cheers, Jory

    Thread Starter duke78

    (@duke78)

    i use the regular pods form with shortcode for frontend form ! thats why i must use this way!

    if i use get_post_meta i get an array of the id’s but i need the values!

    Plugin Author Jory Hogeveen

    (@keraweb)

    i use the regular pods form with shortcode for frontend form ! thats why i must use this way!

    Ah check, we might enhance this in the future so you can add related taxonomies within the form and assign them the “WordPress way”.

    if i use get_post_meta i get an array of the id’s but i need the values!

    Correct, from there you can use WordPress core functions to get the term data.
    You could use get_term( $id ) within a loop for example: https://developer.wordpress.org/reference/functions/get_term/

    Cheers, Jory

    • This reply was modified 4 years, 3 months ago by Jory Hogeveen.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘how to get value of relationship taxonomy field?’ is closed to new replies.