-
Notifications
You must be signed in to change notification settings - Fork 0
/
header-announcements.php
32 lines (24 loc) · 1 KB
/
header-announcements.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
<?php
$announcements = get_posts(array(
'post_type' => 'announcement',
'posts_per_page' => -1
));
?>
<?php foreach ($announcements as $announcement) : ?>
<?php if (get_post_meta($announcement->ID, 'announcement_option_show_global', true)) : ?>
<a href="<?php echo get_permalink($announcement->ID); ?>">
<div class="alert alert-danger border-0 m-0" role="alert" style="display: fixed; background-color: #e40033; color: #FFF;">
<h4 class="mr-5 font-weight-bold"><?php echo get_the_title($announcement); ?></h4>
<span class="">
<?php
if (has_excerpt($announcement->ID)) :
echo get_the_excerpt($announcement->ID);
else :
echo $announcement->post_content;
endif;
?></span>
<span class="">Mehr erfahren ...</span>
</div>
</a>
<?php endif; ?>
<?php endforeach; ?>