Home › Forums › General Issues › some problem with acf taxonomy › Reply To: some problem with acf taxonomy
Hi @james
Thanks for your quick answer and a desire to help.
I will try to explain the problem as detailed as possible.
1. For example – I get custom field “eee”, which should display multiple taxonomy (checkbox) – from parent taxonomy “trip”.
http://joxi.ru/52azJO1IGY1gPA
2. “trip” taxonomy structure in screen:
http://joxi.ru/ZrJYE1Vt1y4QoA
3. Field view in page:
http://joxi.ru/ZrJYE1Vt1y4koA
In final variant I need to display selected taxonomy and link to the page included in this taxonomy.
Example:
– title of selected taxonomy
— post title + url
— post title + url
…
– title of selected taxonomy
— post title + url
— post title + url
…
When I try to use this code:
<?php
$terms = get_field('eee');
if( $terms ): ?>
<ul>
<?php foreach( $terms as $term ): ?>
<h2><?php echo $term->name; ?></h2>
<p><?php echo $term->description; ?></p>
<a href="<?php echo get_term_link( $term ); ?>">View all '<?php echo $term->name; ?>' posts</a>
<?php endforeach; ?>
</ul>
<?php endif; ?>
It does`t give me any values only included taxonomies links (http://joxi.ru/V2VLGlnf0OjaLr) – in castom field I checked 2 taxonomy.
Can`t use ID, because taxonomy not bind to specific pages.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
ACF wouldn’t be so widely used in WordPress if it didn’t have some pretty amazing capabilities. In this article, we look at a few of the features we’ll discuss during “7 things you didn’t know you could do with ACF” at #WPEDecode later this month. https://t.co/5lnsTxp81j pic.twitter.com/Yf0ThPG1QG
— Advanced Custom Fields (@wp_acf) March 16, 2023
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.