if ( have_rows( 'slider' ) ) { ?>
<div class="swiper-container slider">
<div class="swiper-wrapper">
<?php
while ( have_rows( 'slider' ) ) {
the_row();
$image = get_sub_field( 'image' );
?>
<div class="swiper-slide">
<img src="<?php echo wp_get_attachment_image_url( $image['ID'], 'full' ); ?>" />
</div>
<?php
}
?>
</div>
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
<div class="swiper-pagination"></div>
</div>
<?php
}
if ( is_admin() ) { ?>
<script>
var mySwiper = new Swiper('.swiper-container', {
loop: true,
pagination: {
el: '.swiper-pagination',
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
})
</script>
<?php
}
UPDATE wp_postmeta SET meta_value = 'Значение' WHERE meta_key = 'my_product_field';