Home Forums Add-ons Repeater Field Use field taxonomy in repeat


Use field taxonomy in repeat

  • Hello,

    I use in my repeater “categorie_home” a taxonomy (product_cat) “category).
    I can’t display it to show the title and a specific field. I select in a page the categories that I want to display.

    <?php if( have_rows('categorie_home') ): ?>
                <div id="listprojects">
                <?php while ( have_rows('categorie_home') ) : the_row(); ?>   
                    <div class="item">
                        $terms = get_sub_field('categorie');
                        if( $terms ): ?>
                            <?php foreach( $terms as $term ): ?>
                                    <h2><?php echo esc_html( $term->name ); ?></h2>
                            <?php endforeach; ?>
                            <?php wp_reset_postdata(); ?>
                        <?php endif; ?>
                <?php endwhile; ?>
        <?php endif; ?>
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.