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?

    • imvrk

    • September 26, 2020 at 5:02 am

    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>
    
    • imvrk

    • September 26, 2020 at 9:53 pm

    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.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.