Support

Account

Home Forums General Issues Display custom field of taxonomy to post?

Unread

Display custom field of taxonomy to post?

  • Hello guys, I have add a custom field to taxonomy called avatar actor
    [img]https://i.imgur.com/KgYXL7B.png[/img]
    [img]https://i.imgur.com/nzGbH5v.png[/img]
    How can I display it in my post, please help me. Thanks so much

    <?php 
        $queried_object = get_queried_object(); 
        $taxonomy = $queried_object->taxonomy;
        $term_id = $queried_object->term_id;
        
        $actor_avatar = get_field('actor_avatar', $taxonomy . '_' . $term_id);
        $actor_eng_name = get_field('actor_english_name', $taxonomy . '_' . $term_id);
        $actor_dob = get_field('actor_dob', $taxonomy . '_' . $term_id);
        $actor_nation = get_field('actor_nation', $taxonomy . '_' . $term_id);
        $actor_job = get_field('actor_job', $taxonomy . '_' . $term_id);
        $actor_blood = get_field('actor_blood', $taxonomy . '_' . $term_id);
        $actor_forte = get_field('actor_forte', $taxonomy . '_' . $term_id);
        $actor_interests = get_field('actor_interests', $taxonomy . '_' . $term_id);
        $actor_height = get_field('actor_height', $taxonomy . '_' . $term_id);
        $actor_weight = get_field('actor_weight', $taxonomy . '_' . $term_id);
        $actor_gender = get_field('actor_gender', $taxonomy . '_' . $term_id);
        $actor_info = get_field('actor_info', $taxonomy . '_' . $term_id);
    ?>
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.