-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfront-page.php
87 lines (55 loc) · 1.87 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
<?php
/*
Template Name: Homepage
*/
?>
<?php get_header(); ?>
<main>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<section class="hero">
<div class="image" style="background-image:url(<?php the_field('hero_image'); ?>)"></div>
<div class="text">
<p class="subheading"><?php the_field('hero_subtitle'); ?></p>
<h2 class="kilo"><?php the_field('hero_title'); ?></h2>
<a class="button secondary" href="<?php the_field('hero_button_link'); ?>"><?php the_field('hero_button_text'); ?></a>
</div>
</section>
<section class="articles">
<h2>Recent News and Upcoming Events</h2>
<div class="items">
<?php
$featured = get_field('featured_content');
if ( $featured ) {
foreach ( $featured as $post):
setup_postdata($post);
get_template_part('partials/article-sm');
endforeach;
wp_reset_postdata();
}
?>
</div>
</section>
<section class="primary block">
<?php the_field('primary_block'); ?>
<div class="expand">
<a class="button primary" href="javascript:void(0)">Show More</a>
</div>
</section>
<section class="secondary block">
<?php the_field('secondary_block'); ?>
<?php if ( have_rows('button_group') ) : ?>
<div class="buttons"><div class="button-group">
<?php while ( have_rows('button_group') ) : the_row(); ?>
<div>
<a href="<?php echo get_sub_field('link'); ?>" class="button primary"><?php echo get_sub_field('text'); ?></a>
</div>
<?php endwhile; ?>
</div></div>
<?php endif; ?>
<div class="expand">
<a class="button secondary" href="javascript:void(0)">Show More</a>
</div>
</section>
</main>
<?php endwhile; endif; ?>
<?php get_footer(); ?>