-
Notifications
You must be signed in to change notification settings - Fork 0
/
single-post.php
83 lines (80 loc) · 2.38 KB
/
single-post.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
<?php get_header();
if (have_posts()){
while (have_posts()){
the_post();
?>
<h1><?php the_title(); ?></h1>
<h4><?php the_field('article-chapeau'); ?></h4>
<div class="row">
<h5 class="col s12"><?php the_field('sous-titre_1') ?></h5>
<?php
if(!empty(get_field('image_1'))){
$noimage1 = "m6";
} else {
$noimage1 = "";
}
if(!empty(get_field('paragraphe_1'))){
$noparagraphe1 = "m6";
} else {
$noparagraphe1 = "";
$style1 ="style=\"text-align:center\";";
}
?><div class="col s12 <?php echo $noimage1 ?>"><?php the_field('paragraphe_1') ?></div>
<div class="col s12 <?php echo $noparagraphe1 ?>" <?php echo $style1 ?>>
<?php if( get_field('image_1') ): ?>
<img src="<?php the_field('image_1'); ?>" />
<?php endif; ?>
</div>
</div>
<div class="row">
<h5 class="col s12"><?php the_field('sous-titre_2') ?></h5>
<?php
if( !empty(get_field('image_2')) ){
$noimage2 = "m6";
} else {
$noimage2 = "";
}
if(!empty(get_field('paragraphe_2'))){
$noparagraphe2 = "m6";
} else {
$noparagraphe2 = "";
$style2 ="style=\"text-align:center\";";
}
?><div class="col s12 <?php echo $noparagraphe1 ?>" <?php echo $style1 ?>>
<?php if( get_field('image_2') ): ?>
<img src="<?php the_field('image_2'); ?>" />
<?php endif; ?>
</div>
<div class="col s12 <?php echo $noimage2 ?>"><?php the_field('paragraphe_2') ?></div>
</div>
<div class="row">
<h5 class="col s12"><?php the_field('sous-titre_3') ?></h5>
<?php
if( !empty(get_field('image_3')) ){
$noimage3 = "m6";
} else {
$noimage3 = "";
}
if(!empty(get_field('paragraphe_3'))){
$noparagraphe3 = "m6";
} else {
$noparagraphe3 = "";
$style3 ="style=\"text-align:center\";";
}
?><div class="col s12 <?php echo $noimage3 ?>"><?php the_field('paragraphe_3') ?></div>
<div class="col s12 <?php echo $noparagraphe1 ?>" <?php echo $style1 ?>>
<?php if( get_field('image_3') ): ?>
<img src="<?php the_field('image_3'); ?>" />
<?php endif; ?>
</div>
</div>
<p class="posted">Posté le <?php the_time('j F Y') ?></p>
<?php
}
} else {
?>
Nous n'avons pas trouvé d'article répondant à votre recherche
<?php
}
?>
<?php get_footer(); ?>