forked from studieverenigingid/IOB-Website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcategory.php
45 lines (37 loc) · 921 Bytes
/
category.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
<?php
get_header();
?>
<main>
<div class="event--archive__top">
<h1 class="event--archive__title"><span><?php single_cat_title(); ?> events</span></h1>
</div>
<div class="events">
<?php
$cat = get_query_var('cat');
$currentcat = get_category ($cat);
$args = array (
'post_type' => 'event',
'order' => 'DESC',
'posts_per_page' => -1,
'category_name' => $currentcat->slug
);
$the_query = new WP_Query( $args );
?>
<?php if($the_query->have_posts()){?>
<div class="section">
<div class="section__wrapper">
<?php while($the_query->have_posts()) : $the_query->the_post(); ?>
<?php include( 'inc/event-small.php' ); ?>
<?php endwhile; ?>
</div>
</div>
<?php } else {
echo "No posts in ".single_cat_title('', false)." to display";
};
wp_reset_postdata();
?>
</div>
</main>
<?php
get_footer();
?>