Please help! I cannot find examples for this situation.
I’m using the Field Repeater, but have got stuck on how to get the url from a custom taxonomy object.
Field Name: gs_highlight_link
Field Type: Taxonomy
Field Type: Checkbox
I want the user to be able to selet the Woocommerce product category they would like the link to go to.
I have been using something like this for my projects.
hope it helps.
This code is on the taxonomy-(your taxonomy).php file
<?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); // get current term ?>
<?php if ( have_rows('category_slideshow', $term) ): ?>
<?php while ( have_rows('category_slideshow', $term) ) : the_row();
$img = get_sub_field('category_slideshow_image', $term);
<img src="<?php echo $img['url']; ?>" alt="<?php echo $img['alt'] ?>" />
<?php endwhile; ?>
<?php endif; ?>
fazedesigns, thank you! I just got into a similar situation and your tip saved me so much time.