'club-card', 'posts_per_page' => -1, 'lang' => $current_lang, 'post_status' => 'publish', 'sort' => 'menu_order', 'order' => 'ASC', ); return get_posts($args); } } $cards = get_club_cards_for_current_language(); $heading = get_field('heading', $block['id']); $room = get_current_room(); if ($room === 'fitness') { } else { $section_classes = 'bg-cover bg-center bg-no-repeat'; $bg_image = get_template_directory_uri() . '/assets/images/hero-bg.png'; $style_attr = 'style="background-image: url(' . esc_url($bg_image) . ')"'; } if (!function_exists('render_club_card')){ function render_club_card($card) { $card_attribute = get_field('attr', $card->ID); $card_image = get_field('image', $card->ID); $card_heading = get_field('heading', $card->ID); $card_description = get_field('description', $card->ID); $card_price = get_field('price', $card->ID); $card_prices = []; if (have_rows('card_prices', $card->ID)) { while (have_rows('card_prices', $card->ID)) { the_row(); $periods = ['1_month', '3_month', '6_month', '12_month']; foreach ($periods as $period) { if (have_rows($period)) { while (have_rows($period)) { the_row(); $card_prices[$period] = [ 'full' => get_sub_field('full'), 'day' => get_sub_field('day') ]; } } } } } $card_time = []; if (have_rows('time', $card->ID)) { while (have_rows('time', $card->ID)) { the_row(); $card_time[] = [ 'normal_days' => get_sub_field('normal_days'), 'vacation_days' => get_sub_field('vacation_days') ]; } } ?>