wall.php
1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* Wall Block Template.
*
* @param array $block The block settings and attributes.
* @param string $content The block inner HTML (empty).
* @param bool $is_preview True during AJAX preview.
* @param (int|string) $post_id The post ID this block is saved to.
*/
?>
<?php if( have_rows('wall') ): ?>
<?php $rowCount = count( get_field('wall') );
$dir = get_field('direction');
if( $dir == 'right'){
$marquee = 'marquee--reverse';
} ?>
<article class="wrapper">
<div class="marquee <?php echo $marquee; ?>">
<div class="marquee__group">
<?php while( the_repeater_field('wall') ): ?>
<?php $image = get_sub_field('image'); ?>
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
<?php endwhile; ?>
</div>
<div aria-hidden="true" class="marquee__group <?php echo $marquee; ?>">
<?php while( the_repeater_field('wall') ): ?>
<?php $image = get_sub_field('image'); ?>
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
<?php endwhile; ?>
</div>
</div>
</div>
<?php endif; ?>