WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Custom Fields
How to output taxonomy field? (2 posts)

  1. devotee
    Member
    Posted 2 years ago #

    Hello.

    I created a field for my taxonomy 'machinecategory'. The field's name is 'machine_tax_description. How do I output this?

    I´m trying: <?php echo get_field('machine_tax_description', 'machinecategory'); ?>

    But this aint working. What should I do?

    http://wordpress.org/extend/plugins/advanced-custom-fields/

  2. vloo
    Member
    Posted 1 year ago #

    You should add the term id to the second parameter. It should look something like 'machinecategory_34' where 34 is the term_id.

    If you're doing this in your archive/taxonomy page, you can do the following:

    echo get_field('machine_tax_description', 'machinecategory'.$wp_query->queried_object->term_id);

    This works for me :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic