-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcategory.php
More file actions
47 lines (41 loc) · 1.68 KB
/
category.php
File metadata and controls
47 lines (41 loc) · 1.68 KB
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
<!-- Page pour afficher la liste des profs et des projets -->
<?php get_header();
$imageBlank = get_bloginfo('template_directory')."/images/blank.jpg"; //Image par défault
$nomCategorie = get_queried_object() -> name;
$count =0;
$isPageProjet = is_category('projets');
?>
<main class="site__main">
<section class="listeProfs">
<h1 class="listeProfs__titre"><?= $nomCategorie; ?></h1>
<?php if ($isPageProjet) : ?>
<input type="checkbox" id="chk-projets">
<label for="chk-projets" class="btn-projets">
<div class="btn-projets__enfant">Affichage en grille</div>
</label>
<?php endif; ?>
<div class="listeProfs__liste">
<?php //Début boucle ?>
<?php if (have_posts()):
while (have_posts()): the_post();
$titre = get_the_title(); $count++;?>
<?php //Afficher les infos ?>
<a href="<?= get_permalink(); ?>" class="prof" style="animation-delay:-<?= $count*(10/3); ?>s;">
<div class="prof__img">
<?php //Afficher l'image ?>
<img src="<?= (has_post_thumbnail()) ? get_the_post_thumbnail_url() : $imageBlank; ?>" alt="">
</div>
<div class="prof__texte">
<h3 class="prof__titre"><?= $titre; ?></h3>
</div>
</a>
<?php endwhile ?>
<?php endif ?>
<?php //Fin boucle ?>
</div>
</section>
</main>
<?php if ($isPageProjet) : ?>
<style> .prof { animation-duration: <?=$count*(10/3); ?>s; } </style>
<?php endif; ?>
<?php get_footer() ?>