HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: /var/www/html/WPKedushasShabbos/wp-content/themes/kedushas/page-programs.php
<?php /* Template Name: Programs Page */
get_header();
$post_id = 214;
?>
 <section class="trnsf-power-sec">
        <div class="container">
            <div class="bnr-title-block">
                <h2>Tap the transformative power of Shabbos.</h2>
                <p>Through an array of engaging programs for the entire family, join the movement toward experiencing Shabbos like never before.</p>
            </div>

            <div class="inspirational-videos-sec card-items">
                <div class="title-block">
                    <h3>Weekly Inspirational Videos</h3>
                    <p>50,000+ Subscribers</p>
                </div>
             <div class="inspirational-videos-slider">
<?php
$args = array(
    'post_type'      => 'video_series',
    'posts_per_page' => -1, // Get all posts
);

$query = new WP_Query($args);

$all_videos = [];

if ($query->have_posts()) :
    while ($query->have_posts()) :
        $query->the_post();
        $post_id = get_the_ID();

        $video_series = get_post_meta($post_id, '_video_series', true);

        if (!empty($video_series) && is_array($video_series)) {
            foreach ($video_series as $video) {
                if (!empty($video['url'])) {
                    $video['post_id'] = $post_id; // Save the post ID for the permalink
                    $all_videos[] = $video;
                }
            }
        }
    endwhile;

    wp_reset_postdata();

    // Randomize all collected videos
    shuffle($all_videos);

    foreach ($all_videos as $video) {
        $post_id = $video['post_id'];

        // Get thumbnail
        if (empty($video['thumbnail'])) {
            $thumbnail = get_vimeo_thumbnail($video['url']); // You must define this function
        } else {
            $thumbnail = $video['thumbnail'];
        }
        ?>
        <a href="<?php echo esc_url(get_permalink($post_id)); ?>">
            <div class="insp-video-item">
                <div class="insp-video-card">
                    <div class="img-block">
                        <img class="insp-video" src="<?php echo esc_url($thumbnail); ?>" alt="">
                        <button class="video-play-btn">
                            <img src="<?php echo get_template_directory_uri(); ?>/img/vide-insp.png" alt="">
                        </button>
                    </div>
                    <div class="txt-bock">
                        <h4><?php echo esc_html($video['title']); ?></h4>
                        <p><?php echo esc_html($video['subtitle']); ?></p>
                    </div>
                </div>
            </div>
        </a>
        <?php
    }

else :
    echo '<p>No inspirational videos found.</p>';
endif;
?>
</div>



                <div class="btn-block">
                    <a href="<?php echo esc_url(get_permalink($post_id)); ?>" class="more-btn">Learn More</a>
                </div>
            </div>

            <div class="program-sec wmns-prgm-card card-items d-flex">
                <div class="txt-block">
                    <h4>Women’s Learning Program</h4>
                    <div class="arbc-info">נשמת שבת</div>
                    <p>Join over 1000 women and uplift your Shabbos and home with weekly inspiring guided learning, reflections, and connection!</p>
                    <div class="btn-block">
                        <a href="/womens-learning-program" class="more-btn">Learn More</a>
                    </div>
                </div>
                <div class="img-block">
                    <img src="<?php echo get_template_directory_uri(); ?>/img/wmns-crd.png" alt="">
                </div>
                <div class="shape-bg">
                    <img src="<?php echo get_template_directory_uri(); ?>/img/rnd-shape.png" alt="">
                </div>
            </div>

            <div class="program-sec halacha-prgm-card card-items d-flex">
                <div class="img-block">
                    <img src="<?php echo get_template_directory_uri(); ?>/img/halacha-crd.png" alt="">
                </div>
                <div class="txt-block">
                    <h4>Halacha Learning Program</h4>
                    <div class="arbc-info">שבת בשבתו</div>
                    <p>Join over 200 kehilos using our contemporary Halacha program featuring a Shiur-In-A-Box. A weekly shayla, chakira, and mareh mekomos, ready to use, learn, and discuss.</p>
                    <div class="btn-block">
                        <a href="#" class="more-btn">Learn More</a>
                    </div>
                </div>
            </div>

        </div>
    </section>

    <section class="newsletter-section">
        <div class="container custom-container">
            <div class="subtitle">Subscribe to our Newsletter</div>
            <div class="sub-content"> Sign up for our weekly updates to be the first to receive inspiring content, news, events, and downloads.</div>
            <div class="form-sec">
                <form>
                    <div class="row form-inner">
                      <div class="col-md-4">
                        <input type="text" class="form-control" placeholder="Name*" required>
                      </div>
                      <div class="col-md-4">
                        <input type="email" class="form-control" placeholder="Email*" required>
                      </div>
                      <div class="col-md-2">
                        <button type="submit" class="btn btn-submit w-100">Sign up</button>
                      </div>
                    </div>
                  </form>
            </div>
        </div>
   
      
      </section>

<?php 


get_footer(); ?>