Support

Account

Home Forums Add-ons Repeater Field Repeater Taxonomy – URL link

Solving

Repeater Taxonomy – URL link

  • 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
    Taxonomy: product_cat
    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.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Repeater Taxonomy – URL link’ is closed to new replies.