переработал систему модалок и добавил блоки
This commit is contained in:
@@ -29,41 +29,63 @@ if (!function_exists('get_club_cards_for_current_language')) {
|
||||
}
|
||||
|
||||
$cards = get_club_cards_for_current_language();
|
||||
$heading = get_field('heading', $block['id']);
|
||||
?>
|
||||
|
||||
<div id="<?php echo esc_attr($block_id); ?>" class="container mx-auto mt-[24px] <?php echo esc_attr($class_name); ?>">
|
||||
<?php if ($cards): ?>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-[24px]">
|
||||
<?php foreach ($cards as $card): ?>
|
||||
<div class="club-card rounded-[8px] overflow-hidden border transition-shadow ">
|
||||
<?php if (has_post_thumbnail($card->ID)): ?>
|
||||
<div class="aspect-video overflow-hidden">
|
||||
<?php echo get_the_post_thumbnail($card->ID, 'medium', ['class' => 'w-full h-full object-cover']); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="p-[24px]">
|
||||
<h3 class="text-[20px] font-semibold mb-[12px]">
|
||||
<?php echo get_the_title($card->ID); ?>
|
||||
</h3>
|
||||
|
||||
<?php if (get_the_excerpt($card->ID)): ?>
|
||||
<div class="text-gray-600 mb-[16px]">
|
||||
<?php echo get_the_excerpt($card->ID); ?>
|
||||
<section id="<?php echo esc_attr($block_id); ?>" class="<?php echo esc_attr($class_name); ?>">
|
||||
<div class="container mx-auto mt-[24px]">
|
||||
<?php if ($heading) : ?>
|
||||
<h2 class="text-[32px] font-bold mt-[24px]"><?php echo esc_html($heading); ?></h2>
|
||||
<?php endif; ?>
|
||||
<?php if ($cards): ?>
|
||||
<div class="mt-[24px] grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-[30px] max-[768px]:gap-[20px]">
|
||||
<?php foreach ($cards as $card): ?>
|
||||
<div class="bg-[#ffffff] border-[1px] border-[#e5e7eb] rounded-[16px] overflow-hidden shadow-lg hover:shadow-xl transition-shadow ">
|
||||
<?php
|
||||
$card_image = get_field('image', $card->ID);
|
||||
if ($card_image): ?>
|
||||
<div class="overflow-hidden max-w-[60px] max-h-[60px] mx-auto mt-[22px] rounded-full">
|
||||
<img src="<?php echo esc_url($card_image['url']); ?>"
|
||||
alt="<?php echo esc_attr($card_image['alt']); ?>"
|
||||
class="w-full h-full object-cover" />
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<div class="text-center">
|
||||
<button data-modal="club-card"
|
||||
data-card-id="<?php echo $card->ID; ?>"
|
||||
class="inline-block px-[24px] py-[12px] bg-blue-500 text-white rounded-[6px] hover:bg-blue-600 transition-colors ">
|
||||
Подробнее
|
||||
</button>
|
||||
<div class="p-[30px] max-[768px]:p-[20px]">
|
||||
<?php $card_heading = get_field('heading', $card->ID); ?>
|
||||
<?php if ($card_heading): ?>
|
||||
<h3 class="text-[24px] max-[768px]:text-[20px] font-semibold text-[#1f2937] mb-[16px] text-center">
|
||||
<?php echo esc_html($card_heading); ?>
|
||||
</h3>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $card_description = get_field('description', $card->ID); ?>
|
||||
<?php if ($card_description): ?>
|
||||
<div class="text-[16px] max-[768px]:text-[14px] text-[#6b7280] leading-[150%] text-center mb-[16px]">
|
||||
<?php echo wp_kses_post($card_description); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $card_price = get_field('price', $card->ID); ?>
|
||||
<?php if ($card_price): ?>
|
||||
<div class="text-[20px] max-[768px]:text-[18px] font-bold text-[#1f2937] text-center mb-[24px]">
|
||||
<span>От</span> <?php echo esc_html($card_price); ?> Р.
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="text-center mt-auto">
|
||||
<?php $popup_button = get_field('popup_button', $card->ID); ?>
|
||||
<button data-modal="club-card"
|
||||
data-card-id="<?php echo $card->ID; ?>"
|
||||
class="inline-block cursor-pointer px-[24px] py-[12px] bg-[#3b82f6] text-white rounded-[8px] hover:bg-[#2563eb] transition-colors ">
|
||||
<?php echo $popup_button ? esc_html($popup_button) : 'Подробнее'; ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
Reference in New Issue
Block a user