ADD Introducing the component
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
c6f5851014
commit
5a92648654
55
template-parts/components/chapter-section.php
Normal file
55
template-parts/components/chapter-section.php
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
$subtitle = $args['subtitle'];
|
||||
$title = $args['title'];
|
||||
$content = $args['content'];
|
||||
$cta = $args['cta'];
|
||||
$cover = $args['cover'];
|
||||
$cover_size = $args['cover_size'];
|
||||
?>
|
||||
|
||||
|
||||
<section class="deligraph-blocks-chapter-section chapter-section chapter-section--left chapter-section--has-background">
|
||||
|
||||
<svg
|
||||
class="chapter-section__background chapter-section__background--left"
|
||||
width="1302"
|
||||
height="654"
|
||||
viewBox="0 0 1302 654"
|
||||
preserveAspectRatio="none">
|
||||
<path
|
||||
d="M1302 0L0 15.8281V654L1302 642.633L1302 0Z"
|
||||
fill="#136F63" />
|
||||
</svg>
|
||||
|
||||
<div class="chapter-section__content">
|
||||
<div class="chapter-section__innerblocks">
|
||||
<?php if ($subtitle) : ?>
|
||||
<h2 class="wp-block-heading chapter-section__title"><?php echo $subtitle; ?></h2>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($title) : ?>
|
||||
<h3 class="wp-block-heading chapter-section__title"><?php echo $title; ?></h3>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($content) : ?>
|
||||
<p class="chapter-section__title"><?php echo $content; ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<a href="https://televie.be/agir/faire-un-don/" class="wp-block-carhop-blocks-cta align--left" style="color:#136F63;--cta-current-color:#136F63">salut le test<div class="icon"><svg xmlns="http://www.w3.org/2000/svg" id="carhop-fleche-lien-externe-full_svg__fleche-lien-externe-full" viewBox="0 0 32 32" style="--cta-current-color:#136F63">
|
||||
<defs>
|
||||
<style>
|
||||
.carhop-fleche-lien-externe-full_svg__cls-1 {
|
||||
fill: none;
|
||||
stroke: #000;
|
||||
stroke-width: 2px
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<path d="m21.15 10.59-9.38 10.02M21.15 21.4V10.59H10.83" class="carhop-fleche-lien-externe-full_svg__cls-1"></path>
|
||||
<circle cx="16" cy="16" r="15" class="carhop-fleche-lien-externe-full_svg__cls-1"></circle>
|
||||
</svg></div></a>
|
||||
</div>
|
||||
</div>
|
||||
<img decoding="async" class="chapter-section__cover chapter-section__cover--<?php echo $cover_size ?>" src="http://dynamiques.carhop.local/wp-content/uploads/sites/2/2025/05/carhop-soutenir-green.svg" alt="">
|
||||
</section>
|
||||
30
template-parts/revues/card-revue.php
Normal file
30
template-parts/revues/card-revue.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
$ID = $args['ID'];
|
||||
$title = get_the_title($ID);
|
||||
$date = get_the_date('F Y', $ID);
|
||||
$image = get_the_post_thumbnail_url($ID);
|
||||
$link = get_the_permalink($ID);
|
||||
$issue_number = get_field('issue_number', $ID);
|
||||
?>
|
||||
|
||||
<a href="<?php echo $link; ?>" class="card-revue">
|
||||
|
||||
<div class="card-revue__image">
|
||||
<img src="<?php echo $image; ?>" alt="<?php echo $title; ?>">
|
||||
</div>
|
||||
<div class="card-revue__content">
|
||||
<div class="content-meta">
|
||||
<span class="content-meta__type content-meta__type--revue">Revue</span>
|
||||
</div>
|
||||
<h3 class="card-revue__title"><?php echo $title; ?></h3>
|
||||
<time class="card-revue__date" datetime="<?php echo $date; ?>"><?php echo $date; ?></time>
|
||||
</div>
|
||||
|
||||
<div class="issue-number">
|
||||
<?php if ($issue_number) : ?>
|
||||
<span><?php echo $issue_number; ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
|
||||
</a>
|
||||
73
template-parts/revues/revues-grid.php
Normal file
73
template-parts/revues/revues-grid.php
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
$revues = new WP_Query(array(
|
||||
'post_type' => 'revues',
|
||||
'posts_per_page' => -1
|
||||
));
|
||||
$post_count = $revues->post_count;
|
||||
$authors = get_posts(array(
|
||||
'post_type' => 'auteurs',
|
||||
'posts_per_page' => -1
|
||||
));
|
||||
|
||||
$thematiques = get_terms(array(
|
||||
'taxonomy' => 'etiquettes',
|
||||
'hide_empty' => true,
|
||||
));
|
||||
?>
|
||||
|
||||
<section class="revues-grid content-section">
|
||||
<div class="content-section__inner">
|
||||
|
||||
<div class="revues-grid__toolbar">
|
||||
<h2 class="revues-count">
|
||||
<span class="revues-count__count">
|
||||
<?php echo $post_count; ?>
|
||||
</span>
|
||||
<span class="revues-count__text">
|
||||
<?php _e('Revues', 'dynamiques'); ?>
|
||||
</span>
|
||||
</h2>
|
||||
|
||||
<div class="search-bar">
|
||||
<input type="text" placeholder="<?php _e('Rechercher par mot-clé', 'dynamiques'); ?>">
|
||||
</div>
|
||||
|
||||
<div class="revues-grid__toolbar-actions">
|
||||
|
||||
<select name="etiquettes">
|
||||
<option value="1"><?php _e('Thématiques', 'dynamiques'); ?></option>
|
||||
<?php foreach ($thematiques as $thematique) : ?>
|
||||
<option value="<?php echo $thematique->term_id; ?>"><?php echo $thematique->name; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<select name="auteurs">
|
||||
<option value="1"><?php _e('Auteur·e·s', 'dynamiques'); ?></option>
|
||||
<?php foreach ($authors as $author) : ?>
|
||||
<option value="<?php echo $author->ID; ?>"><?php echo $author->post_title; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
|
||||
<select name="sort_by">
|
||||
<option value="recent" selected><?php _e('Numéros récents en premier', 'dynamiques'); ?></option>
|
||||
<option value="oldest"><?php _e('Numéros anciens en premier', 'dynamiques'); ?></option>
|
||||
<option value="alphabetical"><?php _e('Par ordre alphabétique', 'dynamiques'); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<ul class="revues-grid__list">
|
||||
|
||||
<?php if ($revues->have_posts()) : ?>
|
||||
<?php while ($revues->have_posts()) : $revues->the_post(); ?>
|
||||
<?php get_template_part('template-parts/revues/card-revue', null, array(
|
||||
|
||||
'date' => get_the_date(),
|
||||
'image' => get_the_post_thumbnail_url(),
|
||||
'link' => get_the_permalink(),
|
||||
'ID' => get_the_ID()
|
||||
)); ?>
|
||||
<?php endwhile; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
Loading…
Reference in New Issue
Block a user