-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhomepage.php
121 lines (116 loc) · 3.94 KB
/
homepage.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
115
116
117
118
119
120
121
<?php
/*
* Template name: Home
*/
?>
<?php get_header(); ?>
<?php if(have_posts()): while(have_posts()) : the_post(); ?>
<section id="welcome">
<div class="container">
<div class="six columns offset-by-three">
<div class="welcome-content">
<h2><?php echo arp_get_headline(); ?></h2>
<p><?php echo arp_get_headline_description(); ?></p>
<p><a class="button" href="<?php echo arp_get_headline_url(); ?>"><?php _e('Learn more', 'arp'); ?></a></p>
</div>
</div>
</div>
<?php
$header = get_custom_header();
$image = get_post($header->attachment_id);
?>
<div class="bg-caption"><?php echo apply_filters('the_content', $image->post_excerpt); ?></div>
</section>
<div class="container">
<div class="nine columns">
<?php
query_posts('post_type=carousel&posts_per_page=-1');
if(have_posts()) :
?>
<section id="carousel">
<nav class="carousel-nav">
<?php
while(have_posts()) : the_post();
?>
<a href="#" data-postid="<?php the_ID(); ?>"></a>
<?php
endwhile;
?>
</nav>
<div class="carousel-items">
<?php
while(have_posts()) : the_post();
?>
<article class="carousel-item" data-postid="<?php the_ID(); ?>">
<a href="<?php the_field('url'); ?>" <?php if(get_field('target_blank')) echo 'target="_blank"'; ?>><?php the_post_thumbnail('highlight'); ?></a>
<div class="carousel-item-meta">
<h2><a href="<?php the_field('url'); ?>" <?php if(get_field('target_blank')) echo 'target="_blank"'; ?>><?php the_title(); ?></a></h2>
<?php the_excerpt(); ?>
</div>
</article>
<?php
endwhile;
?>
</div>
</section>
<?php
endif;
wp_reset_query();
?>
</div>
<div class="three columns">
<section id="social">
<div class="social-bg"></div>
<div class="social-content">
<h2><?php _e('Connect with us', 'arp'); ?></h2>
<?php
$fb = get_field('site_options_facebook', 'option');
$tw = get_field('site_options_twitter', 'option');
$yt = get_field('site_options_youtube', 'option');
?>
<?php if($fb) : ?>
<a class="fa fa-facebook" href="<?php echo $fb; ?>" target="_blank" rel="extenal" title="Facebook"></a>
<?php endif; ?>
<?php if($yt) : ?>
<a class="fa fa-youtube" href="<?php echo $yt; ?>" target="_blank" rel="external" title="YouTube"></a>
<?php endif; ?>
<?php if($tw) : ?>
<a class="fa fa-twitter" href="<?php echo $tw; ?>" target="_blank" rel="external" title="Twitter"></a>
<?php endif; ?>
</div>
</section>
<section id="latest" class="page-section clean">
<h2 class="section-title"><?php _e('Latest news', 'arp'); ?></h2>
<?php
query_posts('posts_per_page=3');
if(have_posts()) :
while(have_posts()) :
the_post();
?>
<article class="post-item small clearfix">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail'); ?></a>
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
</article>
<?php
endwhile;
endif;
wp_reset_query();
?>
</section>
</div>
</div>
<div id="home-map-info">
<div class="container">
<div class="twelve columns">
<h2><?php _e('Amazon River Basins', 'arp'); ?></h2>
</div>
</div>
</div>
<section id="map">
<div class="arp-map">
<?php echo arp_get_home_map(); ?>
</div>
</section>
<?php get_template_part('parts/basins', 'section'); ?>
<?php endwhile; endif; ?>
<?php get_footer(); ?>