Sometime I will have 2 links or 1 link.
<a target="_blank" href="<?php the_sub_field('playlist-url'); ?>"><?php the_sub_field('media-player'); ?></a>
I want to add "or" between the 2 links. So if there are 2 links, add "or" For example, "Soundcloud or Youtube"
If there is 1 links don't add "or". For example, "Soundcloud"
<div class="container-wrap" id="music">
<?php
$args = array('post_type' => 'music-playlist-1');
$query = new WP_Query($args);
$cntr = 0;
while( $query -> have_posts() ) : $query -> the_post(); $cntr++; ?>
<section class="row-wrap">
<div class="row-inner">
<?php if ($cntr % 2 == 1) { ?>
<?php
$image = get_field('artwork');
if( !empty($image) ): ?>
<img class="artwork" src="<?php echo $image['url']; ?>">
<?php endif; ?>
<div class="artwork-content">
<h1><?php the_field('playlist-name'); ?></h1>
<button class="btn-wrap">
<div class="btn">listen now</div>
</button>
<div class="option-bar">
<?php
// check if the repeater field has rows of data
if( have_rows('playlist_link') ):
// loop through the rows of data
while ( have_rows('playlist_link') ) : the_row();
?>
<a target="_blank" href="<?php the_sub_field('playlist-url'); ?>"><?php the_sub_field('media-player'); ?></a>
<?php
endwhile;
else :
// no rows found
endif;
?>
</div>
</div>
<?php } else { ?>
<div class="artwork-content">
<h1><?php the_field('playlist-name'); ?></h1>
<button class="btn-wrap">
<div class="btn">listen now</div>
</button>
<div class="option-bar">
<?php
// check if the repeater field has rows of data
if( have_rows('playlist_link') ):
// loop through the rows of data
while ( have_rows('playlist_link') ) : the_row();
?>
<a target="_blank" href="<?php the_sub_field('playlist-url'); ?>"><?php the_sub_field('media-player'); ?></a>
<?php
endwhile;
else :
// no rows found
endif;
?>
</div>
</div>
<?php
$image = get_field('artwork');
if( !empty($image) ): ?>
<img class="artwork" src="<?php echo $image['url']; ?>">
<?php endif; ?>
<?php } ?>
</div>
</section>
<?php endwhile; ?>
<?php wp_reset_query(); ?>