-
Notifications
You must be signed in to change notification settings - Fork 3
/
homepage.php
117 lines (115 loc) · 4.17 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
<?php
/*
* Template name: Home page
*/
?>
<?php get_header(); ?>
<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
<?php get_template_part('parts/hero'); ?>
<section id="content">
<div class="main-text">
<div class="container">
<div class="eight columns">
<p>
<?php
// get and split project_description, first phrase will be highlighted
$project_description = get_post_meta(get_the_ID(), 'project_description', true);
$project_description = explode('.', $project_description, 2);
?>
<strong>
<?php echo $project_description[0] ?>.
</strong>
<?php echo $project_description[1] ?>
</p>
<hr class="dark"/>
</div>
</div>
<div id="mc_svg" class="svg">
<?php include(TEMPLATEPATH . '/img/mc.svg'); ?>
</div>
</div>
<div class="container">
<div class="row">
<div class="five columns">
<section class="content-section pink-section connect-border connect-left">
<div class="content-section-content first-content">
<header class="content-section-header">
<h2>Notícias</h2>
</header>
<?php
// First post, which should display a featured image
$first_post_query = new WP_Query(array(
'posts_per_page' => 1,
'post__in' => get_option('sticky_posts'),
'ignore_sticky_posts' => 1
));
while($first_post_query->have_posts()) :
$first_post_query->the_post();
?>
<article class="post">
<div class="post-thumbnail" style="background-image:url(http://lorempixel.com/700/700/);"></div>
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<div class="meta">
<p class="author">
<?php
echo get_avatar(get_the_author_meta('ID'), $size = '30');
?>
<?php echo get_the_author(); ?>
</p>
<p class="date">
<span class="fa fa-clock-o"></span>
<?php echo get_the_date(); ?>
</p>
</div>
</article>
<?php
wp_reset_postdata();
endwhile;
?>
</div>
<div class="content-section-content secondary-content">
<?php
$posts_query = new WP_Query(array(
'ignore_sticky_posts' => 1,
'post__not_in' => get_option('sticky_posts'),
'posts_per_page' => 2
));
while($posts_query->have_posts()) :
$posts_query->the_post();
?>
<article class="post">
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<div class="meta">
<p class="author">
<?php
echo get_avatar(get_the_author_meta('ID'), $size = '30');
?>
<?php echo get_the_author(); ?>
</p>
<p class="date">
<span class="fa fa-clock-o"></span>
<?php echo get_the_date(); ?>
</p>
</div>
</article>
<?php
wp_reset_postdata();
endwhile;
?>
</div>
<p><a class="button block">Veja mais notícias</a></p>
</section>
</div>
<?php query_posts('post_type=network_post'); ?>
<?php if(have_posts()) : ?>
<div class="six columns offset-by-one">
<?php get_template_part('parts/network-blog'); ?>
</div>
<?php endif; ?>
<?php wp_reset_query(); ?>
</div>
</div>
</section>
<?php get_template_part('parts/community-section'); ?>
<?php endwhile; endif; ?>
<?php get_footer(); ?>