forked from ejohann/fictional-university-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfront-page.php
114 lines (100 loc) · 4.5 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php get_header(); ?>
<div class="page-banner">
<div class="page-banner__bg-image" style="background-image: url(<?php echo get_theme_file_uri('images/library-hero.jpg'); ?>);"></div>
<div class="page-banner__content container t-center c-white">
<h1 class="headline headline--large">Welcome!</h1>
<h2 class="headline headline--medium">We think you’ll like it here.</h2>
<h3 class="headline headline--small">Why don’t you check out the <strong>major</strong> you’re interested in?</h3>
<a href="<?php echo get_post_type_archive_link('program'); ?>" class="btn btn--large btn--blue">Find Your Major</a>
</div>
</div>
<div class="full-width-split group">
<div class="full-width-split__one">
<div class="full-width-split__inner">
<h2 class="headline headline--small-plus t-center">Upcoming Events</h2>
<?php
$today = date('Ymd');
$homepageEvents = new WP_Query(array(
'posts_per_page' => 2,
'post_type' => 'event',
'meta_key' => 'event_date',
'orderby' => 'meta_value_num',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => 'event_date',
'compare' => '>=',
'value' => $today,
'type' => 'numeric'
)
)
));
while($homepageEvents->have_posts()){
$homepageEvents->the_post();
get_template_part('/template-parts/content', 'event');
}
wp_reset_postdata();
?>
<p class="t-center no-margin"><a href="<?php echo get_post_type_archive_link('event'); ?>" class="btn btn--blue">View All Events</a></p>
</div>
</div>
<div class="full-width-split__two">
<div class="full-width-split__inner">
<h2 class="headline headline--small-plus t-center">From Our Blogs</h2>
<?php
$homepagePosts = new WP_Query(array(
'posts_per_page' => 2
));
while($homepagePosts->have_posts()){
$homepagePosts->the_post(); ?>
<div class="event-summary">
<a class="event-summary__date event-summary__date--beige t-center" href="<?php the_permalink(); ?>">
<span class="event-summary__month"><?php the_time('M'); ?></span>
<span class="event-summary__day"><?php the_time('d'); ?></span>
</a>
<div class="event-summary__content">
<h5 class="event-summary__title headline headline--tiny"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
<p>
<?php
if(has_excerpt())
{
echo get_the_excerpt();
}
else
{
echo wp_trim_words(get_the_content(), 18);
}
?>
<a href="<?php the_permalink(); ?>" class="nu gray">Read more</a></p>
</div>
</div>
<?php }
wp_reset_postdata();
?>
<p class="t-center no-margin"><a href="<?php echo site_url("/blog"); ?>" class="btn btn--yellow">View All Blog Posts</a></p>
</div>
</div>
</div>
<div class="hero-slider">
<?php
$homepageSlides = new WP_Query(array(
'posts_per_page' => -1,
'post_type' => 'slider'
));
while($homepageSlides->have_posts()){
$homepageSlides->the_post();
$slider_image = get_field('slider_image');
$image_url = $slider_image['url'];
$slider_link = get_field('slide_link'); ?>
<div class="hero-slider__slide" style="background-image: url(<?php echo $image_url; ?>);">
<div class="hero-slider__interior container">
<div class="hero-slider__overlay">
<h2 class="headline headline--medium t-center"><?php the_title(); ?></h2>
<p class="t-center"><?php the_content(); ?></p>
<p class="t-center no-margin"><a href="<?php echo $slider_link; ?>" class="btn btn--blue">Learn more</a></p>
</div>
</div>
</div>
<?php } wp_reset_postdata(); ?>
</div>
<?php get_footer(); ?>