-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsingle-cc_course.php
72 lines (69 loc) · 2.45 KB
/
single-cc_course.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
<?php
get_header();
the_post();
?>
<section class="main-content">
<header class="single-header single-header--course">
<div class="container">
<?php get_template_part( 'inc/partials/entry/course', 'header' ); ?>
</div>
</header>
<div class="container">
<div class="columns margin-top-0 is-desktop">
<div class="column is-3 has-background-soft-gold course-sidebar">
<div class="entry-meta margin-top-xxl">
<?php
$course_duration = get_post_meta( get_the_ID(), 'course_duration', true );
$course_language = get_post_meta( get_the_ID(), 'course_language', true );
$course_url = get_post_meta( get_the_ID(), 'course_apply_url', true );
if ( !empty( $course_duration ) || !empty( $course_language ) || !empty( $course_url ) ) {
if ( !empty( $course_url ) ) {
echo '<div class="column">';
echo '<a href="'.$course_url.'" class="button is-info">Register here</a>';
echo '</div>';
}
if ( !empty( $course_duration ) ) {
echo '<div>';
echo '<strong>Duration: </strong>';
echo $course_duration;
echo '</div>';
}
if ( !empty( $course_language ) ) {
echo '<div>';
echo '<strong>Language: </strong>';
echo $course_language;
echo '</div>';
}
}
?>
<a href="" class="button register margin-top-bigger">Register Here</a>
</div>
</div>
<div class="column is-9">
<section class="entry-page-content margin-top-xxl padding-horizontal-xxl">
<div class="text-format body-big">
<?php the_content(); ?>
</div>
<?php
$upcoming_events = Certificates_Website::get_upcoming_course_events( get_the_ID() );
if ( !empty( $upcoming_events ) ) {
echo '<h3>Upcoming Dates</h3>';
echo '<div class="columns padding-top-bigger">';
foreach ( $upcoming_events as $event ) {
$entry_date = get_post_meta( $event->ID, 'event_dtstart_date', true );
echo '<div class="column">';
echo Components::card_post_event( $event->ID, false, $entry_date );
echo '</div>';
}
echo '</div>';
}
?>
<footer class="entry-footer">
<?php get_template_part( 'inc/partials/entry/page', 'footer' ); ?>
</footer>
</section>
</div>
</div>
</div>
</section>
<?php get_footer(); ?>