forked from JoshuaD84/dhara-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfront-page.php
More file actions
40 lines (40 loc) · 1.34 KB
/
front-page.php
File metadata and controls
40 lines (40 loc) · 1.34 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
<?php get_header();
if (is_restricted()) {
show_404();
} else {
?>
<div id="home-page-content" class="page-content">
<?php
if (have_posts()) {
while (have_posts()) {
the_post();
the_content();
}
}
?>
<div id="home-page-news-feed">
<?php
$recent_posts = wp_get_recent_posts(['category' => 50, 'post_status' => 'publish']);
echo "<h2>Announcements</h2>";
echo '<ul id="home-page-news-items">';
$view_previous_prefix = '';
if (!empty($recent_posts)) {
foreach ($recent_posts as $recent) {
echo '<li class="home-page-news-item">';
echo '<a href="' . get_permalink($recent["ID"]) . '">' . $recent["post_title"] . '</a>';
echo '</li>';
}
} else {
$view_previous_prefix = "There are no current announcements. ";
}
echo '<li>';
echo '<a href="/category/front-page/old-announcements/">' . $view_previous_prefix . 'View previous announcements ...' . '</a>';
echo '</li>';
echo '</ul>';
wp_reset_query();
?>
</div>
</div>
<?php
}
get_footer();