mtc_repeaters_loop – rhj
// Add Shortcode
function mtc_repeaters_func() {
ob_start();
// vars
$audio = get_field('audio-player');
$audio_divider = '<hr style="margin-top:15px;margin-bottom:15px;border-color:var(--color-alt);" />';
if( $audio ){
echo '<div>' . $audio . '</div>';
echo $audio_divider;
}
// vars
$summary = get_field('rhj_summary');
$guests = get_field('rhj_guests');
$links = get_field('rhj_info_links');
$search = array('<p>','<p class="has-drop-cap">','<p class="has-drop-cap segment_summary">','<p class="p1">');
$newsummary = str_replace($search,"", $summary);
$first = substr($newsummary, 0, 1);
$rest = substr($newsummary, 1);
$finalsummary = '<div class="has-drop-cap">' . $newsummary . '</div>';
$summary_divider = '<hr class="hr-guests" style="max-width:50px;width:50px;min-width:50px!important;margin: 15px auto 10px -2px!important" />';
if( $summary ){
echo $finalsummary;
echo $summary_divider;
}
if( $guests ){
echo '<h4 class="rhj_guests_heading">Guest Information:</h4>';
echo '<div class="guests">';
echo $guests;
echo '</div>';
}
if( $links ){
echo '<h4 class="links_plural_header">Links for more info:</h4>';
echo '<div style="margin-bottom: 10px;">';
echo $links;
echo '</div>';
}
$content = ob_get_contents();
ob_end_clean();
return $content;
}
add_shortcode( 'mtc_repeaters_loop', 'mtc_repeaters_func' );