PHP Classes

File: templates/events/list.php

Recommend this page to a friend!
  Classes of Maniruzzaman Akash   Event Story Manager Plugin   templates/events/list.php   Download  
File: templates/events/list.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Event Story Manager Plugin
Manage and publish regional events in WordPress
Author: By
Last change:
Date: 0 years ago
Size: 1,713 bytes


Class file image Download
<?php if ( ! defined('ABSPATH') ) exit; ?>

<?php get_header(); ?>

<div class="container-fluid event-story">
    <div class="row">
        <?php while ($events->have_posts()) : $events->the_post(); ?>
<div class="col-4">
                <div class="card card-body event-story-list-content">
                    <h5 class="card-title event-title">
                        <?php the_title(); ?>
                        <?php echo esc_html_e( 'Date', 'event-story' ); ?> :
                        <?php echo esc_html( get_post_meta( get_the_ID(), 'event_date', true ) ); ?>
                        <?php echo esc_html_e( 'Location', 'event-story' ); ?> :
                        <?php echo esc_html( get_post_meta( get_the_ID(), 'event_location', true ) ); ?>

                    <div class="mt-4">
                        <a href="<?php the_permalink(); ?>" class="btn btn-primary">
                            <?php echo esc_html_e( 'Details', 'event-story' ); ?>
                        <a target="_blank" href="<?php echo get_post_meta( get_the_ID(), 'event_url', true ); ?>" class="btn btn-warning ml-2">
                            <?php echo esc_html_e( 'Visit', 'event-story' ); ?>
        <?php endwhile; ?>

        <!-- If no event found, render another template -->
        <?php if ( ! $events->have_posts() ) : ?>
<?php event_story_get_template_part( 'events/no-event' ); ?>
<?php endif; ?>


<?php get_footer(); ?>