-
Notifications
You must be signed in to change notification settings - Fork 1
/
page-bulletins.php
55 lines (48 loc) · 1.57 KB
/
page-bulletins.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
<?php
/**
* Created by PhpStorm.
* User: Scott
* Date: 20/10/2018
* Time: 11:57 AM
*/
get_header();
?>
<div class="row">
<?php get_sidebar(); ?>
<div class="col-xs-12 col-md-9 main">
<?php get_breadcrumb(); ?>
<div class="content bulletins">
<?php
if (have_posts()) :
while (have_posts()) : the_post(); ?>
<h1><?php the_title() ?></h1>
<?php
the_content();
endwhile;
endif;
?>
<?php
$bulletin_args = [
'post_type' => 'attachment',
'category_name' => 'Bulletin',
'orderby' => 'title',
'posts_per_page' => 999
];
foreach (get_posts($bulletin_args) as $post):
setup_postdata($post);
?>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3">
<a href="<?= wp_get_attachment_url(get_the_ID()); ?>" target="_blank" class="tile bulletin">
<img src="<?= wp_get_attachment_image_src(get_the_ID(), 'thumbnail')[0]; ?>" alt="<?php the_title() ?>">
<span><?= nl2br(get_the_content(get_the_ID())); ?></span>
</a>
</div>
<?php
endforeach;
wp_reset_postdata();
?>
</div>
</div>
</div>
<?php
get_footer();