HEX
Server: Apache/2.4.46 (Ubuntu)
System: Linux localhost 5.11.0-49-generic #55-Ubuntu SMP Wed Jan 12 17:36:34 UTC 2022 x86_64
User: root (0)
PHP: 7.4.16
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/acharya-rajnikant-backup/wp-content/themes/aacharyarajnikant/event.php
<?php

/**
 * Template Name: Event Page
 */
get_header(); ?>
<!-- ================> Event section start here <================== -->
<div class="event padding--top padding--bottom bg-light">
    <div class="container">
        <div class="section__header text-center">
            <h2>Recent Event</h2>
            <p>Enthusiastically underwhelm quality benefits rather than professional outside the box thinking.
                Distinctively network highly efficient leadership skills</p>
        </div>
        <div class="section__wrapper">
            <div class="row g-4 justify-content-center">
                <?php
                $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
                $args = array(
                    'post_type'      => 'event',
                    'posts_per_page' => 6,
                    'paged'          => $paged,
                    'post_status'    => 'publish',
                );
                $event_query = new WP_Query($args);

                if ($event_query->have_posts()) :
                    while ($event_query->have_posts()) : $event_query->the_post();
                        $event_date = get_field('event_date');
                        $event_time = get_field('event_time');
                        $event_location = get_field('event_location');

                        $day = '';
                        $month = '';
                        if ($event_date) {
                            $date_obj = date_create($event_date);
                            $day = date_format($date_obj, 'd');
                            $month = date_format($date_obj, 'M');
                        }
                ?>
                        <div class="col-lg-4 col-sm-6 col-12">
                            <div class="event__item">
                                <div class="event__inner">
                                    <div class="event__thumb">
                                        <a href="<?php the_permalink(); ?>">
                                            <?php if (has_post_thumbnail()) : ?>
                                                <?php the_post_thumbnail('full'); ?>
                                            <?php else : ?>
                                                <img src="<?php echo get_template_directory_uri(); ?>/assets/images/event/01.jpg" alt="event thumb">
                                            <?php endif; ?>
                                        </a>
                                        <?php if ($day && $month) : ?>
                                            <div class="event__thumb-date">
                                                <h6><?php echo esc_html($day); ?></h6>
                                                <p><?php echo esc_html($month); ?></p>
                                            </div>
                                        <?php endif; ?>
                                    </div>
                                    <div class="event__content">
                                        <a href="<?php the_permalink(); ?>">
                                            <h5><?php the_title(); ?></h5>
                                        </a>
                                        <div class="event__metapost">
                                            <ul class="event__metapost-info">
                                                <?php if ($event_time) : ?>
                                                    <li><i class="far fa-clock"></i> <?php echo esc_html($event_time); ?></li>
                                                <?php endif; ?>
                                                <?php if ($event_location) : ?>
                                                    <li><i class="fas fa-map-marker-alt"></i> <?php echo esc_html($event_location); ?></li>
                                                <?php endif; ?>
                                            </ul>
                                            <ul class="event__metapost-comentshare">
                                                <li class="event__metapost-coment">
                                                    <i class="far fa-comments"></i>
                                                    <a href="<?php comments_link(); ?>" class="event__metapost-count"><?php echo get_comments_number(); ?></a>
                                                </li>
                                                <li class="event__metapost-share">
                                                    <i class="fas fa-share-alt"></i>
                                                    <ul>
                                                        <li><a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo urlencode(get_permalink()); ?>" target="_blank"><i class="fab fa-facebook-f"></i></a></li>
                                                        <li><a href="https://twitter.com/intent/tweet?text=<?php echo urlencode(get_the_title()); ?>&url=<?php echo urlencode(get_permalink()); ?>" target="_blank"><i class="fab fa-twitter"></i></a></li>
                                                        <li><a href="https://www.linkedin.com/shareArticle?mini=true&url=<?php echo urlencode(get_permalink()); ?>&title=<?php echo urlencode(get_the_title()); ?>" target="_blank"><i class="fab fa-linkedin-in"></i></a></li>
                                                    </ul>
                                                </li>
                                            </ul>
                                        </div>
                                        <?php the_excerpt(); ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    <?php
                    endwhile;
                    ?>
            </div>
            <?php aacharyarajnikant_pagination($event_query); ?>
        <?php
                    wp_reset_postdata();
                else :
        ?>
            <p class="text-center">No events found. Stay tuned for updates!</p>
        <?php endif; ?>
        </div>
    </div>
</div>
<!-- ================> Event section end here <================== -->


<?php get_footer(); ?>