-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle-program.php
More file actions
83 lines (75 loc) · 2.96 KB
/
single-program.php
File metadata and controls
83 lines (75 loc) · 2.96 KB
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
<?php
/**
* Template Name: Program Keahlian
* Post Type: program
*/
get_header();
?>
<div class="container">
<div class="section">
<div class="page-wrapper">
<div class="page-content">
<?php
if (have_posts()) :
while (have_posts()) : the_post();
?>
<article class="post-content">
<h1 class="post-title"><?php the_title(); ?></h1>
<?php
if (has_post_thumbnail()) {
echo '<div class="post-featured-image">';
the_post_thumbnail('large');
echo '</div>';
}
?>
<div class="post-body">
<?php the_content(); ?>
</div>
</article>
<!-- Related Program -->
<div style="margin-top: 50px;">
<?php
$related_args = array(
'post_type' => 'program',
'posts_per_page' => 6,
'post__not_in' => array(get_the_ID())
);
$related_query = new WP_Query($related_args);
if ($related_query->have_posts()) {
echo '<h2 class="section-title">Mapel Pilihan Lainnya</h2>';
echo '<div class="posts-grid">';
while ($related_query->have_posts()) : $related_query->the_post();
?>
<article class="post-card">
<div class="post-card-image">
<?php echo sekolah_thumbnail('medium'); ?>
</div>
<div class="post-card-content">
<h3 class="post-card-title"><?php the_title(); ?></h3>
<p class="post-card-excerpt"><?php echo sekolah_excerpt(15); ?></p>
<a href="<?php the_permalink(); ?>" class="post-card-link">Lihat →</a>
</div>
</article>
<?php
endwhile;
echo '</div>';
wp_reset_postdata();
}
?>
</div>
<?php
endwhile;
endif;
?>
</div>
<aside class="sidebar">
<?php
if (is_active_sidebar('primary-sidebar')) {
dynamic_sidebar('primary-sidebar');
}
?>
</aside>
</div>
</div>
</div>
<?php get_footer(); ?>