Home › Forums › General Issues › How to display taxonomy checkbox links on WooCommerce product category archive › Reply To: How to display taxonomy checkbox links on WooCommerce product category archive
You need to do the same for the tax field as with all your others and set the second parameter the same way.
<?php $queried_object = get_queried_object(); $taxonomy = $queried_object->taxonomy; $term_id = $queried_object->term_id; $related_terms = get_field('quick_links', $taxonomy . '_' . $term_id); if( $related_terms ): ?> <ul> <?php foreach( $related_terms as $related_term ): ?> <a href="<?php echo get_term_link( $related_term ); ?>"><?php echo $related_term->name; ?></a> <?php endforeach; ?> </ul> <?php endif; ?>
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!
🚀 This week’s session of ACF Chat Fridays dips into the preliminary results of our first ever user survey. Don’t miss it! https://t.co/3UtvQbDwNm pic.twitter.com/kMwhaJTkZc— Advanced Custom Fields (@wp_acf) May 9, 2023
© 2023 Advanced Custom Fields.