-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfront-page.php
169 lines (132 loc) · 4.74 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?php
get_header();
?>
<?php if(have_posts()): ?>
<?php while(have_posts()): the_post(); ?>
<section class="hi">
<div class="text">
<h2 class="post-title" role="heading" aria-level="2">
<?php the_title() ?>
</h2>
<div><?php the_content() ?></div>
</div>
</section>
<?php endwhile; ?>
<?php endif; ?>
<section class="projects">
<div class="text">
<?php
// the query
$the_query = new WP_Query( array( 'post_type' => 'projets' , 'Genre' => 'intro') ); ?>
<?php if ( $the_query->have_posts() ) : ?>
<!-- pagination here -->
<!-- the loop -->
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<h2 role="heading" aria-level="2"><?php the_title() ?></h2>
<div><?php the_excerpt() ?></div>
<?php endwhile; ?>
<!-- end of the loop -->
<!-- pagination here -->
<?php wp_reset_postdata(); ?>
<?php else: ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>
</div>
<?php
// the query
$the_query = new WP_Query( array( 'post_type' => 'projets' , 'Genre' => 'important') ); ?>
<?php if ( $the_query->have_posts() ) : ?>
<!-- pagination here -->
<div class="photos-right">
<!-- the loop -->
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<a href="<?php the_permalink(); ?>"><figure>
<img src="<?php the_field('image_section_une')?>" alt="">
<figcaption>
<h3 role="heading" aria-level="3"><?php the_title(); ?></h3>
<div><?php the_excerpt(); ?></div>
</figcaption>
</figure></a>
<?php endwhile; ?>
<!-- end of the loop -->
</div>
<!-- pagination here -->
<?php wp_reset_postdata(); ?>
<?php else: ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>
<?php
// the query
$the_query = new WP_Query( array( 'post_type' => 'projets' , 'Genre' => 'moins') ); ?>
<?php if ( $the_query->have_posts() ) : ?>
<!-- pagination here -->
<div class="photos-left">
<!-- the loop -->
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<a href="<?php the_permalink(); ?>"><figure>
<img src="<?php the_field('image_section_une')?>" alt="">
<figcaption>
<h3 role="heading" aria-level="3"><?php the_title(); ?></h3>
<div><?php the_excerpt(); ?></div>
</figcaption>
</figure></a>
<?php endwhile; ?>
<!-- end of the loop -->
</div>
<!-- pagination here -->
<?php wp_reset_postdata(); ?>
<?php else: ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>
</section>
<section class="news">
<?php
// the query
$the_query = new WP_Query( 'post_type=post&posts_per_page=2'); ?>
<?php if ( $the_query->have_posts() ) : ?>
<!-- pagination here -->
<div class="newPosts">
<h2 class="newsPosts" role="heading" aria-level="2">Derniers articles du blog</h2>
<!-- the loop -->
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<a href="<?php the_permalink(); ?>">
<article role="article">
<h3 role="heading" aria-level="3"><?php the_title(); ?> <span><time date="<?php the_time('Y-m-d') ?>" pubdate><?php echo(get_the_date()) ?></time></span></h3>
<span>Posté par <?php the_author() ?></span>
<div><?php the_excerpt(); ?></div>
<span class="more">Lire la suite</span>
</article>
</a>
<?php endwhile; ?>
<!-- end of the loop -->
</div>
<!-- pagination here -->
<?php wp_reset_postdata(); ?>
<?php else: ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>
<div class="interrest">
<h2>Interrests</h2>
<?php
// the query
$the_query = new WP_Query( 'post_type=interrests'); ?>
<?php if ( $the_query->have_posts() ) : ?>
<!-- pagination here -->
<!-- the loop -->
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<article role="article">
<h3 role="heading" aria-level="3"><?php the_title(); ?> <span><time date="<?php the_time('Y-m-d') ?>" pubdate><?php echo(get_the_date()) ?></time></span></h3>
<div><?php the_excerpt(); ?></div>
</article>
<?php endwhile; ?>
<!-- end of the loop -->
<!-- pagination here -->
<?php wp_reset_postdata(); ?>
<?php else: ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>
</div>
</section>
<?php
get_footer();
?>