Support

Account

Home Forums Add-ons Repeater Field How to display taxonomy with text from repeater?

Helping

How to display taxonomy with text from repeater?

  • hello everyone
    i need help to display taxonomy with text from repeater?
    this code working but content from custom taxonomies duplicates to frontend
    im not understand this it.

    
    <div class="s-container">
        <div class="s-slider -m1.2 -d5">
            <?php if(have_rows('cast')):
                    while(the_repeater_field('cast')): 
                        $tax = 'celebrity_cat';
                        $types = get_terms( array( 
                                'order' => 'des',   
                        )
                    );
                    foreach($types as $type) {
                        $term_link = get_term_link( $type );
                        $image = get_field('celebrity_avatar', 'celebrity_cat_' . $type->term_id . '' );
                        $charecter = get_sub_field('charecter'); 
                        if ( has_term( $type->term_id, 'celebrity_cat')) {
            ?>
        <div class="slider">
            <article id="post-<?php the_ID(); ?>" <?php post_class('content-item -card'); ?>>
            <?php
                        echo '<div class="pic">';
                            echo '<a href="' . esc_url( $term_link ) . '">';
                                echo '<img width="350" height="184"  src="' . $image['url'] . '" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" ';
                            echo '</a>';
                        echo '</div>'; 
                        echo '<div class="info">';
                            echo '<header class="entry-header">';
                                echo '<h3 class="entry-title">';
                                    echo '<a href="' . esc_url( $term_link ) . '">';
                                        echo '<span>'. $type->name . '</span>';
                                    echo '</a>';
                                echo '</h3>';
                                    echo $charecter; 
                            echo '</header">';
                        echo '</div>';
                        //break;    
                    ?>
            </article>
        </div>
            <?php } }  ?>  
            <?php endwhile; ?>
            <?php endif; ?>
        </div>
    </div>
    
  • Now

    charecter field

    not display how to fix it.
    Thank you.

    
            <?php if( have_rows('cast') ): 
                    $tax = 'celebrity_cat';
                    $types = get_terms( array( 
                        'order' => 'des',   
                        )
                    );
                    foreach($types as $type) { 
                        $term_link = get_term_link( $type );
                        $person_name = get_field('celebrity_name'); 
                        $image = get_field('celebrity_avatar', 'celebrity_cat_' . $type->term_id . '' ); 
                        $charecter = get_field('charecter'); 
    
                        if ( has_term( $type->term_id, 'celebrity_cat')) {
                ?>
                <div class="slider">
                <article id="post-<?php the_ID(); ?>" <?php post_class('content-item -card'); ?>>
                    <?php
                        echo '<div class="pic">';
                            echo '<a href="' . esc_url( $term_link ) . '">';
                                echo '<img width="350" height="184"  src="' . $image['url'] . '" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" ';
                            echo '</a>';
                        echo '</div>'; 
                        echo '<div class="info">';
                            echo '<header class="entry-header">';
                                echo '<h3 class="entry-title">';
                                    echo '<a href="' . esc_url( $term_link ) . '">';
                                        echo '<span>'. $type->name . '</span>';
                                    echo '</a>';
                                echo '</h3>';
    
                                ?>
                                <?php echo $celebrity_name; ?>
                                <?php
    
                            echo '</header">';
                        echo '</div>';
                        //break;    
                    ?>
    
                </article>
                </div>
                <?php } }  ?>  
            <?php endif; ?>
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.