-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-archiver.php
160 lines (155 loc) · 5.62 KB
/
page-archiver.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
<?php
get_header();
$pageID = get_the_ID();
?>
<section class="">
<div class="bg-img bg-archive" style="background-image: url(<?php bloginfo('template_url'); ?>/src/images/archive-img.jpg)"></div>
</section>
<?php
$posts_textos = new WP_Query( array(
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => 3,
'order' => 'DESC',
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'id',
'terms' => '24',
),
),
) );
if ($posts_textos) {
?>
<section id="nossos-textos" class="my-5">
<div class="container">
<div class="row">
<div class="col-12 mb-4">
<h1 class="line-green"><?php echo get_cat_name( $category_id = 24 ); ?></h1>
</div>
<?php
foreach ( $posts_textos->posts as $post ) {
$thumbtextos = get_the_post_thumbnail_url( $post->ID, 'full');
$categoria = get_the_category( $post->ID )[0]->name;
$category_id = get_cat_ID( $categoria );
$category_link = get_category_link( $category_id );
$link = get_permalink( $post->ID );
?>
<div class="col-12 col-lg-4 pr-lg-5">
<a href="<?php echo $link ?>">
<div class="box-arquivo">
<img src="<?php echo $thumbtextos ?>" alt="">
<div class="text-arquivo">
<h4><?php the_title(); ?></h4>
<p><?php the_excerpt(); ?></p>
</div>
</div>
</a>
</div>
<?php wp_reset_postdata();
} ?>
<div class="col-12 btn-arquivo">
<a href="<?php echo $category_link; ?>"><button class="btn-primario">En savoir plus</button></a>
</div>
</div>
</div>
</section>
<?php }
$posts_multimidia = new WP_Query( array(
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => 3,
'order' => 'DESC',
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'id',
'terms' => '22',
),
),
) );
if ($posts_multimidia) {
?>
<section id="multimidia" class="my-5 bg-img bg-arquivo" style="background-image:url(<?php bloginfo('template_url'); ?>/src/images/quadro.png)">
<div class="container">
<div class="row">
<div class="col-12 mb-4">
<h1 class="line-green"><?php echo get_cat_name( $category_id = 22 ); ?></h1>
</div>
<?php
foreach ( $posts_multimidia->posts as $post ) {
$thumbmulti = get_the_post_thumbnail_url( $post->ID, 'full');
$categoria = get_the_category( $post->ID )[0]->name;
$category_id = get_cat_ID( $categoria );
$category_link = get_category_link( $category_id );
$link = get_permalink( $post->ID );
?>
<div class="col-12 col-lg-4 pr-lg-5">
<a href="<?php echo $link ?>">
<div class="box-arquivo">
<img src="<?php echo $thumbmulti ?>" alt="">
<div class="text-arquivo">
<h4><?php the_title(); ?></h4>
<p><?php the_excerpt(); ?></p>
</div>
</div>
</a>
</div>
<?php wp_reset_postdata();
} ?>
<div class="col-12 btn-arquivo">
<a href="<?php echo $category_link; ?>"><button class="btn-primario">En savoir plus</button></a>
</div>
</div>
</div>
</section>
<?php }
$posts_leitura = new WP_Query( array(
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => 3,
'order' => 'DESC',
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'id',
'terms' => '20',
),
),
) );
if ($posts_leitura) {
?>
<section id="nossas-leituras" class="my-5">
<div class="container">
<div class="row">
<div class="col-12 mb-4">
<h1 class="line-green"><?php echo get_cat_name( $category_id = 20 ); ?></h1>
</div>
<?php
foreach ( $posts_leitura->posts as $post ) {
$thumbleitura = get_the_post_thumbnail_url( $post->ID, 'full');
$categoria = get_the_category( $post->ID )[0]->name;
$category_id = get_cat_ID( $categoria );
$category_link = get_category_link( $category_id );
$link = get_permalink( $post->ID );
?>
<div class="col-12 col-lg-4 pr-lg-5">
<a href="<?php echo $link ?>">
<div class="box-arquivo">
<img src="<?php echo $thumbleitura ?>" alt="">
<div class="text-arquivo">
<h4><?php the_title(); ?></h4>
<p><?php the_excerpt(); ?></p>
</div>
</div>
</a>
</div>
<?php wp_reset_postdata();
} ?>
<div class="col-12 btn-arquivo">
<a href="<?php echo $category_link; ?>"><button class="btn-primario">En savoir plus</button></a>
</div>
</div>
</div>
</section>
<?php } get_footer(); ?>