-
Notifications
You must be signed in to change notification settings - Fork 1
/
front-page.php
67 lines (44 loc) · 1.38 KB
/
front-page.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
56
57
58
59
60
61
62
63
64
65
66
67
<?php
/**
* The template for displaying a static front page
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package Transit_Base_Template
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main">
<?php
get_template_part( 'template-parts/asset', 'planner' );
// Only a static front page will potentially have a featured image attached
if ( has_post_thumbnail() ): ?>
<div id="homepage-image">
<?php the_post_thumbnail( 'full' ); ?>
</div>
<br style="clear: both; margin-bottom: 2rem;" />
<?php endif; ?>
<div id="homepage-news">
<?php
$news_query = new WP_Query( array('posts_per_page' => '3') );
if ( $news_query->have_posts() ) :
?>
<h2>Recent News</h2>
<ul>
<?php while ( $news_query->have_posts() ) : $news_query->the_post(); ?>
<li class="news-item">
<a class="item-title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<span class="date"> <?php the_time( get_option('date_format') ); ?></span>
</li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
</div>
<?php
tcp_do_alerts( array('collapse' => 'false', 'sep_affected' => ', ' ) );
?>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_template_part( 'homepage-widgets' );
get_footer();