        <div class="testomonials__mobile owl-carousel owl-theme">
<?php 
$testimonials = carbon_get_post_meta( get_the_ID(), 'crb_opinie' );
$counter = 0;
echo '<div class="item">';
foreach ($testimonials as $testimonial) {
    if ($counter > 0 && $counter % 2 == 0) {
        echo '</div><div class="item">'; // закрываем div и открываем новый каждые 2 отзыва
    }
    ?>
    <div class="testomonial__element">
        <div class="basic__info">
            <div class="photo">
                <img src="<?= $testimonial['opinia_zdjecie'] ?>" alt="portrait">
            </div>
            <div class="name">
                <div class="rate">
                    <?php for ($i = 0; $i < 5; $i++) : ?>
                        <img src="<?=get_template_directory_uri()?>/assets/images/star.svg" alt="star">
                    <?php endfor; ?>
                </div>
                <p class="name__p"><?= $testimonial['opinia_imie'] ?></p>
            </div>
        </div>
        <div class="testomonial__text">
            <p><?= $testimonial['opinia_tresc'] ?></p>
        </div>
    </div>
    <?php
    $counter++;
}
echo '</div>';
?>

        </div>

        <div class="custom-nav">
            <div class="prev">
                <img src="<?php echo esc_url(get_template_directory_uri() . '/assets/images/prev.svg'); ?>" alt="Previous" />
            </div>
            <div class="next">
                <img src="<?php echo esc_url(get_template_directory_uri() . '/assets/images/next.svg'); ?>" alt="Next" />
            </div>
        </div>