-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage-archives.php
66 lines (62 loc) · 2.11 KB
/
page-archives.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
<?php
/**
* Template Name: Archives
*
* @package facyl
*/
get_header(); ?>
<main class="site-main">
<script>
document.addEventListener('DOMContentLoaded', (event) => {
document.getElementById("searchArchives").addEventListener("submit", function(e) {
e.preventDefault() // Cancel the default action
sendContactForm();
});
});
</script>
<section class="realisations">
<?php
if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb( '<p id="breadcrumbs">','</p>' );
}
?>
<h1> <?php the_title(); ?> </h1>
<h2><span class="sr-only">Vous pouvez trier nos réalisations en utilisant les filtres ou en faisant une recherche</span></h2>
<?php
$categories = get_categories();
?>
<ul class="cat-list">
<li class="cat-list_article">
<button class="cat-list_item cat-list_item_handicap active" href="#!" data-slug="">Aucun filtre</button>
</li>
<?php foreach ( $categories as $category ) : ?>
<li class="cat-list_article">
<button class="cat-list_item cat-list_item_handicap" href="#!" data-slug="<?php echo $category->slug; ?>">
<?php echo $category->name; ?> (<?php echo $category->count ?>)
</button>
</li>
<?php endforeach; ?>
</ul>
<form action="" method="get" class="search-query" id="searchArchives">
<label for="searchbar" class="sr-only">Rechercher à l'aide de mots clés</label>
<input type="text" name="search" id="searchbar" class="searchbar" placeholder="Rechercher..." required>
<input type="submit" href="#" class="search-button" value=">">
</form>
<?php
$projects = new WP_Query([
'post_type' => 'post',
'posts_per_page' => -1,
'order_by' => 'date',
'order' => 'desc',
]);
if ( $projects->have_posts() ) : ?>
<ul class="articles newsPreview">
<?php while ( $projects->have_posts() ) : $projects->the_post();
get_template_part( 'template-parts/component/realisations' );
endwhile; ?>
</ul>
<?php wp_reset_postdata(); ?>
<?php endif; ?>
</section>
</main>
<?php get_footer();