Custom Taxonomy – fields

I have a custom taxonomy called projects that has a custom post type called apartments, both have acf custom fields.
I want to bring the taxonomy created projects with their acf fields on a certain page, example project 1, project 2.
I have created taxonomy-projects_apartments.php and used it as a template, for a page called projects.

$args = array(
‘taxonomy’ => ‘projects’,
‘orderby’ => $orderby,
‘show_count’ => $show_count,
‘pad_counts’ => $pad_counts,
‘hierarchical’ => $hierarchical,
‘title_li’ => $title

wp_list_categories( $args );

This only brings the names, project 1 and project 2. On the single project page I use:

$queried_object = get_queried_object();
$taxonomy = $queried_object->taxonomy;
$term_id = $queried_object->term_id;

// load content for this taxonomy term
$custom_field = get_field(‘insert_new_project’, ‘projects’ . ‘_’ . $term_id);

to bring custom fields, and it works.
But queried objects brings the current page object, and does not work in the way I needed it to.
Any suggestions ?

Read more here:: Custom Taxonomy – fields

Leave a Reply

Your email address will not be published. Required fields are marked *