forked from N-Jaro/iguide-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage-i-guide-webinar-series.php
121 lines (104 loc) · 5.54 KB
/
page-i-guide-webinar-series.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
/*
Template Name: Webinar Page
*/
get_header();
?>
<!-- Page Title Section (Tailwind CSS) -->
<div class="page-title tw-w-full tw-block tw-relative tw--mt-[200px] tw-pt-[200px]">
<div class="tw-container tw-mx-auto tw-px-4 tw-h-min-[200px] tw-pb-[80px] tw-pt-12">
<div class="tw-border-l-8 tw-pl-3 tw-border-ig-orange tw-text-white tw-font-semibold tw-text-2xl">
<h1>I-GUIDE Webinars</h1>
</div>
</div>
</div>
<!-- Page Content Section (Tailwind CSS) -->
<div class="page-content tw-w-full tw-flex tw-relative tw-bg-white tw-mt-5 tw-mb-16">
<div class="tw-container tw-mx-auto tw-px-4 tw-py-6">
<p>The Institute for Geospatial Understanding through an Integrative Discovery Environment (<a href="https://i-guide.io/">I-GUIDE</a>) aims to transform geospatial data-intensive sciences through the integration of AI and cyberGIS, reproducible data-intensive analytics and modeling, FAIR (Findable, Accessible, Interoperable, and Reusable) data principles, and innovative education and workforce development programs. I-GUIDE’s webinar series showcases innovative research and education advanced by I-GUIDE collaborators and partners.</p>
<hr/>
<?php
// Query only 'webinar' category posts from 'vco' post type
$webinar_args = array(
'post_type' => 'vco',
'posts_per_page' => -1,
'tax_query' => array(
array(
'taxonomy' => 'vco_category',
'field' => 'slug',
'terms' => 'webinar',
),
),
'meta_key' => 'vco_date_time',
'orderby' => 'meta_value_num',
'order' => 'DESC',
);
$webinar_query = new WP_Query( $webinar_args );
if ( $webinar_query->have_posts() ) :
while ( $webinar_query->have_posts() ) : $webinar_query->the_post();
$date_time = get_post_meta( get_the_ID(), 'vco_date_time', true );
$speakers = get_post_meta( get_the_ID(), 'vco_speakers', true );
$video_embed_code = get_post_meta( get_the_ID(), 'vco_embedded_video', true );
$registration_link = get_post_meta( get_the_ID(), 'vco_registration_link', true );
$abstract = get_post_meta( get_the_ID(), 'vco_abstract', true );
// Calculate the webinar end time (date_time + 2 hours)
$webinar_end_time = $date_time + (2 * HOUR_IN_SECONDS);
$current_time = current_time( 'timestamp' ); // Get the current time in timestamp
?>
<!-- Webinar Entry Card (Bootstrap CSS) -->
<div class="card mb-5 border-0">
<div class="card-body">
<!-- Date and Time (Formatted as: Wednesday, January 22, 2025 | 12:00 (Central Time)) -->
<p class="text-muted small">
<?php echo date_i18n( 'l, F j, Y | g:i A', $date_time ); ?> (Central Time)
</p>
<!-- Title -->
<h2 class="card-title">
<a href="<?php the_permalink(); ?>" class="text-decoration-none text-primary">
<?php the_title(); ?>
</a>
</h2>
<!-- Registration Button (Bootstrap) -->
<?php if ( $registration_link && $current_time <= $webinar_end_time ) : ?>
<a href="<?php echo esc_url( $registration_link ); ?>" target="_blank" class="btn btn-warning btn-lg my-3">
Register Now
</a>
<?php endif; ?>
<!-- Speaker List (Bootstrap List Group) -->
<?php if ( !empty( $speakers ) ) : ?>
<h5 class="mt-4">Speakers:</h5>
<ul">
<?php foreach ( $speakers as $speaker ) :
$name = isset( $speaker['name'] ) ? $speaker['name'] : '';
$affiliation = isset( $speaker['affiliation'] ) ? $speaker['affiliation'] : '';
?>
<li><?php echo esc_html( $name . ( $affiliation ? ', ' . $affiliation : '' ) ); ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<!-- Abstract Section -->
<?php if ( !empty( $abstract ) ) : ?>
<h5 class="mt-4">Abstract:</h5>
<p class="text-secondary">
<?php echo wp_kses_post( wpautop( $abstract ) ); ?>
</p>
<?php endif; ?>
<!-- Embedded Video (Bootstrap) -->
<?php if ( !empty( $video_embed_code ) ) : ?>
<div class="mt-4">
<?php echo $video_embed_code; ?>
</div>
<?php endif; ?>
</div>
</div>
<hr/>
<?php endwhile;
wp_reset_postdata();
else : ?>
<p class="alert alert-info"><?php _e( 'No webinars found.', 'vco-plugin' ); ?></p>
<?php endif; ?>
</div>
</div>
<?php
get_footer();
?>