Support

Account

Home Forums General Issues Displaying Taxonomy fields on Archive template

Unread

Displaying Taxonomy fields on Archive template

  • I am using ACF with Oxygen. I have one post type “product” and two taxonomies “store” and “collection”, both taxonomy has multiple custom fields. I have created an archive template, the same template applies to both the taxonomies i.e store and collection. I am using the below php function to return the taxonomy field value. The problem the field value of store is only visible on the stores archive page in the front end. and the field value of collection is only visible on the collection archive page in front end.

    Both the archive page is suppose to display the products, the store name (i.e the store taxonomy custom field), collection name (i.e the collection taxonomy custom field).
    How can i display the store fields on collections page and collection fields on stores page?

    function get_tax_field($field_name) {
    $term = get_queried_object();
    return get_field($field_name, $term);
    }

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.