Изображение ACF в Reapeter внутри группы не работает - PullRequest
0 голосов
/ 18 февраля 2020
<div class="section2">
<?php
    // Stop if there's nothing to display.
    if (!have_rows('section2')) {
        return false;
    }
    if (have_rows('section2')): 
?>
        <?php while (have_rows('section2')): the_row();
    // Services Sub Repeater.
    if (have_rows('packages')): ?>
    <?php
        while (have_rows('packages')): the_row();
            $title = get_sub_field('title');
            $quote = get_sub_field('quote');
            $image = get_sub_field('image');
            $title_image = get_sub_field('title_image');
            $caption = get_sub_field('caption');
            $desc = get_sub_field('desc');
            $link_text = get_sub_field('link_text');
            $link = get_sub_field('link_text');
        ?>
            <div class="container">
                <h1><?php echo esc_html($title); ?></h1>
                <div class="quote-triangle">
                    <p>
                    <?php echo esc_html($quote); ?>
                    </p>
                    <div class="quote__moving-border"></div>
                </div>
                <div class="wrapper-content">
                    <div data-aos="fade-right">
                        <div class="wrapper-content__leftside">
                    <img src="<?php echo $image['url']; ?>" alt="" class="left-side__icon">
                        </div>
                    </div>
                    <div data-aos="fade-right" data-aos-delay="200">
                        <div class="wrapper-content__rightside">
                            <h6><?php echo esc_html($title_image); ?></h6>
                            <div class="caption"><?php echo esc_html($caption); ?></div>
                            <div class="desc">
                            <?php echo esc_html($desc); ?>
                            </div>
                            <div class="click">
                                <a href="<?php echo $link; ?>" class="click__a">
                                    <img src="<?php bloginfo('template_directory');?>/assets/img/icons/right-arrow-grey.svg" alt=""
                                        class="click__right-arrow">
                                    <h6><?php echo esc_html($link_text); ?></h6>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        <?php endwhile;?>
    <?php endif;?>
    <?php endwhile;?>
    <?php endif;?>
</div>

Этот код Повторный вызов внутри группы Я получил это по этой ссылке https://allisontarr.com/2017/12/01/acf-repeater-within-group/ все переменные работают правильно , кроме $ image I так старался изменить код PHP внутри тега, но ничего не произошло. Кстати, я новичок в Wordpress и надеюсь найти решение, спасибо.

...