Compare commits

...

12 Commits

28 changed files with 961 additions and 20 deletions

View File

@ -9,6 +9,7 @@
'url' => get_stylesheet_directory_uri() . '/resources/img/covers/carhop-page-analyses-etudes-cover.svg', 'url' => get_stylesheet_directory_uri() . '/resources/img/covers/carhop-page-analyses-etudes-cover.svg',
'alt' => 'Revues' 'alt' => 'Revues'
), ),
'has_overlap' => true,
'background_style' => 'sliced', 'background_style' => 'sliced',
'cta' => array( 'cta' => array(
'title' => __('Trouver une publication', 'carhop'), 'title' => __('Trouver une publication', 'carhop'),
@ -16,22 +17,89 @@
) )
)); ?> )); ?>
<div class="latest-parutions">
<h2 class="latest-parutions__title title-small">Dernière parution</h2>
<?php
$latest_analyse = get_posts(array(
'posts_per_page' => 1, // Number of recent posts thumbnails to display
'post_status' => 'publish', // Show only the published posts
'post_type' => 'analyses-etudes',
'orderby' => 'date',
'order' => 'DESC',
'tax_query' => array(
array(
'taxonomy' => 'type',
'field' => 'slug',
'terms' => 'analyse',
),
),
));
$latest_etude = get_posts(array(
'posts_per_page' => 1, // Number of recent posts thumbnails to display
'post_status' => 'publish', // Show only the published posts
'post_type' => 'analyses-etudes',
'orderby' => 'date',
'order' => 'DESC',
'tax_query' => array(
array(
'taxonomy' => 'type',
'field' => 'slug',
'terms' => 'etude',
),
),
));
$recent_posts = array_merge($latest_analyse, $latest_etude);
?>
<?php foreach ($recent_posts as $post) : ?>
<?php
$type = get_the_terms($post->ID, 'type');
?>
<div class="post-card post-card--analyses-etudes">
<?php if (is_array($type) && !empty($type) && isset($type[0]->name)) : ?>
<div class="latest-parution__item">
<div class="content-meta">
<span class="content-meta__type content-meta__type--revue"><?php echo $type[0]->name; ?></span>
<p class="content-meta__revue-issue content-meta__revue-issue--green">
<span class="revue-issue-number revue-meta__label sr-only">Numéro</span>
28
</p>
</div>
<?php endif; ?>
<a href="<?php echo get_the_permalink($post->ID); ?>">
<?php echo get_the_post_thumbnail($post->ID, 'medium'); ?>
<h3><?php echo get_the_title($post->ID); ?></h3>
</a>
</div>
</div>
<?php endforeach; ?>
</div>
<?php get_template_part('template-parts/revues/revues-grid'); ?> <!-- #### ANALYSES ET ETUDES POST GRID #### -->
<?php get_template_part('template-parts/analyses-etudes/analyses-etudes-grid'); ?>
<!-- #### EXPLORE TAGS #### -->
<!-- #### SOUTENIR #### -->
<?php <?php
$block_content = '<!-- wp:dynamiques-blocks/explore-tags /-->'; $composition_id = 988;
echo do_blocks($block_content); $soutenir_content = get_post_field('post_content', $composition_id);
if ($soutenir_content) {
echo do_blocks($soutenir_content);
}
?> ?>
<!-- #### PROCHAINEMENT #### -->
<?php get_template_part('template-parts/components/decouvrez-prochainement'); ?>
<!-- #### INFOLETTRE #### --> <!-- #### INFOLETTRE #### -->
<?php get_template_part('template-parts/components/subscribe-infolettre'); ?> <?php
$composition_id = 992;
$_infolettre_content = get_post_field('post_content', $composition_id);
if ($_infolettre_content) {
echo do_blocks($_infolettre_content);
}
?>
</main> </main>
<?php <?php

50
archive-expositions.php Normal file
View File

@ -0,0 +1,50 @@
<?php get_header(); ?>
<?php
$current_post_type = get_post_type();
?>
<main id="content" class="site-content flex-grow">
<?php get_template_part('template-parts/expositions/archive-header'); ?>
<!-- #### LATEST PARUTIONS #### -->
<?php get_template_part('template-parts/components/archive/latest-parutions', null, array(
'post_amount' => 1,
'post_type' => 'expositions',
));
?>
<!-- #### ANALYSES ET ETUDES POST GRID #### -->
<?php get_template_part('template-parts/components/archive/post-grid', null, array(
'current_post_type' => 'expositions',
'post_amount' => -1,
'grid_title' => 'Trouver une exposition',
)); ?>
<!-- #### SOUTENIR #### -->
<?php
$composition_id = 988;
$soutenir_content = get_post_field('post_content', $composition_id);
if ($soutenir_content) {
echo do_blocks($soutenir_content);
}
?>
<!-- #### INFOLETTRE #### -->
<?php
$composition_id = 992;
$_infolettre_content = get_post_field('post_content', $composition_id);
if ($_infolettre_content) {
echo do_blocks($_infolettre_content);
}
?>
</main>
<?php
get_footer();

View File

@ -0,0 +1,51 @@
<?php get_header(); ?>
<?php
$current_post_type = get_post_type();
?>
<main id="content" class="site-content flex-grow">
<?php get_template_part('template-parts/outils-pedagogiques/archive-header'); ?>
<!-- #### LATEST PARUTIONS #### -->
<?php get_template_part('template-parts/components/archive/latest-parutions', null, array(
'post_amount' => $post_amount,
'post_type' => 'outils-pedagogiques',
));
?>
<!-- #### POST GRID #### -->
<?php get_template_part('template-parts/components/archive/post-grid', null, array(
'current_post_type' => 'outils-pedagogiques',
'post_amount' => -1,
'grid_title' => 'Trouver un outil pédagogique',
)); ?>
<!-- #### SOUTENIR #### -->
<?php
$composition_id = 988;
$soutenir_content = get_post_field('post_content', $composition_id);
if ($soutenir_content) {
echo do_blocks($soutenir_content);
}
?>
<!-- #### INFOLETTRE #### -->
<?php
$composition_id = 992;
$_infolettre_content = get_post_field('post_content', $composition_id);
if ($_infolettre_content) {
echo do_blocks($_infolettre_content);
}
?>
</main>
<?php
get_footer();

39
archive.php Normal file
View File

@ -0,0 +1,39 @@
<?php get_header(); ?>
<?php
$current_post_type = get_post_type();
?>
<main id="content" class="site-content flex-grow">
<?php if ($current_post_type === 'analyses-etudes') : ?>
<?php get_template_part('template-parts/analyses-etudes/archive-header'); ?>
<?php elseif ($current_post_type === 'expositions') : ?>
<?php get_template_part('template-parts/expositions/archive-header'); ?>
<?php endif; ?>
<?php get_template_part('template-parts/expositions/archive-latest-parutions', null, array()); ?>
<!-- #### SOUTENIR #### -->
<?php
$composition_id = 988;
$soutenir_content = get_post_field('post_content', $composition_id);
if ($soutenir_content) {
echo do_blocks($soutenir_content);
}
?>
<!-- #### INFOLETTRE #### -->
<?php
$composition_id = 992;
$_infolettre_content = get_post_field('post_content', $composition_id);
if ($_infolettre_content) {
echo do_blocks($_infolettre_content);
}
?>
</main>
<?php
get_footer();

View File

@ -0,0 +1,33 @@
<?php
// THE POST TYPE IS DECLARED IN THE MU-PLUGINS/CARHOP-POST-TYPES.PHP FILE
function handle_posts_analyses_etudes_numerotation_remapping()
{
// Ne s'exécuter que dans l'admin pour éviter de surcharger le frontend
if (!is_admin()) {
return;
}
$args = array(
'post_type' => 'analyses-etudes',
'posts_per_page' => -1,
'orderby' => 'date',
'order' => 'ASC',
);
$query = new WP_Query($args);
if ($query->have_posts()) {
while ($query->have_posts()) {
$query->the_post();
$current_numerotation = $query->current_post + 1;
update_post_meta(get_the_ID(), 'post_numerotation', $current_numerotation);
}
wp_reset_postdata();
}
}
add_action('save_post', 'handle_posts_analyses_etudes_numerotation_remapping');
add_action('delete_post', 'handle_posts_analyses_etudes_numerotation_remapping');

View File

@ -21,6 +21,10 @@ ol li {
} }
} }
.alignnormal {
max-width: var(--wp--style--global--content-size, 960px);
}
.align-extra-wide { .align-extra-wide {
max-width: var(--wp--style--global--wide-size, 1280px); max-width: var(--wp--style--global--wide-size, 1280px);
} }

View File

@ -1,5 +1,5 @@
.chapter-section--width-full + .content-box { .chapter-section--width-full + .content-box {
margin-top: -80px; /* margin-top: -80px; */
} }
.content-box + .subscribe-infolettre { .content-box + .subscribe-infolettre {

View File

@ -160,10 +160,16 @@
.chapter-section--width-full.chapter-section--has-background .chapter-section--width-full.chapter-section--has-background
+ .chapter-section--width-full.chapter-section--has-background { + .chapter-section--width-full.chapter-section--has-background {
@apply !-mt-20; /* @apply !-mt-20; */
@apply bg-red-500;
} }
.wp-block-carhop-blocks-content-box .chapter-section { .wp-block-carhop-blocks-content-box .chapter-section {
@apply py-8 md:py-10; @apply py-8 md:py-10;
min-height: unset; min-height: unset;
} }
.has-background.alignfull + .chapter-section {
@apply !mt-0 !pt-16 !pb-16;
min-height: 30vh;
}

View File

@ -2,32 +2,62 @@
@apply pt-2 md:pt-20 px-4 md:px-16; @apply pt-2 md:pt-20 px-4 md:px-16;
/* overflow: visible !important; */ /* overflow: visible !important; */
overflow: hidden !important; overflow: hidden !important;
&.alignfull { @apply !mt-12;
@apply !my-0; /* &.alignfull {
@apply !my-8;
} */
&:not(:has(.related-articles)) {
@apply pb-16;
}
&--has-light-bg {
@apply text-primary;
.content-meta__revue-issue {
@apply bg-primary !text-white;
}
}
&--has-dark-bg {
@apply text-white;
.content-meta__revue-issue {
@apply bg-white !text-primary;
}
} }
&__inner { &__inner {
@apply max-w-screen-2xl mx-auto; @apply max-w-screen-2xl mx-auto;
} }
.content-meta {
color: currentColor;
.content-meta__type {
color: currentColor;
}
}
&__header { &__header {
@apply flex flex-wrap items-end justify-between gap-8 gap-y-2 uppercase text-4xl mb-6 md:mb-12; @apply flex flex-wrap items-end justify-between gap-8 gap-y-2 uppercase text-4xl mb-6 md:mb-12;
.block-title { .block-title {
@apply flex grow items-end justify-between gap-8 uppercase text-2xl md:text-4xl lg:text-5xl; @apply flex grow items-end justify-between gap-8 uppercase text-2xl md:text-4xl lg:text-5xl;
color: currentColor !important;
span { span {
@apply block shrink-0; @apply block shrink-0;
color: currentColor !important;
} }
&:after { &:after {
@apply w-full z-20 block mb-2; @apply w-full z-20 block mb-2;
height: 1px; height: 1px;
content: ' '; content: ' ';
background-color: currentColor;
} }
} }
.header-link { .header-link {
@apply text-lg font-medium nunito flex items-center gap-3; @apply text-lg font-medium nunito flex items-center gap-3;
text-transform: none; text-transform: none;
span { span {
@apply pt-1; @apply pt-1;
color: currentColor !important;
} }
svg { svg {
@ -35,7 +65,8 @@
transition: transform 0.3s ease-in-out; transition: transform 0.3s ease-in-out;
path, path,
circle { circle {
@apply stroke-white stroke-2; @apply stroke-2;
stroke: currentColor !important;
} }
} }
&:hover { &:hover {
@ -66,7 +97,7 @@
font-weight: 100 !important; font-weight: 100 !important;
} }
&__issue-content-wrapper { &__issue-content-wrapper {
@apply grid gap-y-6 gap-12 lg:gap-36 pb-24 overflow-hidden lg:overflow-visible; @apply grid gap-y-6 gap-12 lg:gap-36 pb-12 overflow-hidden lg:overflow-visible;
@screen md { @screen md {
grid-template-columns: 61.8fr 38.2fr; grid-template-columns: 61.8fr 38.2fr;
} }
@ -163,6 +194,10 @@
} }
} }
section.alignfull + .block-dernieres-dynamiques {
@apply !mt-0;
}
.is-website-dynamiques .block-dernieres-dynamiques { .is-website-dynamiques .block-dernieres-dynamiques {
@apply bg-primary text-white; @apply bg-primary text-white;
&__header { &__header {
@ -188,18 +223,24 @@
} }
} }
.is-website-carhop .block-dernieres-dynamiques { .is-website-carhop .block-dernieres-dynamiques {
@apply bg-carhop-orange-50 text-primary; @apply bg-carhop-orange-50;
&__header { &__header {
.block-title:after { .block-title:after {
@apply bg-primary;
} }
} }
:is(p, span, h1, h2, h3, h4, h5, h6):not(.article-card *) { :is(p, span, h1, h2, h3, h4, h5, h6, a):not(
@apply text-primary; .article-card *,
.content-meta__revue-issue
) {
color: currentColor !important;
} }
.related-articles:after { .related-articles:after {
@apply content-none hidden; @apply content-none hidden;
} }
} }
.block-dernieres-dynamiques:has(+ .explore-tags) {
@apply !mb-0;
}

View File

@ -0,0 +1,8 @@
.post-card--analyses-etudes {
.card__details-date {
@apply text-primary;
}
time {
@apply text-primary capitalize mt-3 block;
}
}

View File

@ -1,6 +1,10 @@
.page-header { .page-header {
@apply bg-primary text-white py-16 items-center relative; @apply bg-primary text-white py-16 items-center relative;
&--has-overlap {
@apply pb-64 -mb-48;
}
&--sliced-background { &--sliced-background {
@apply bg-transparent; @apply bg-transparent;
&::before { &::before {

View File

@ -0,0 +1,134 @@
.post-grid {
&__toolbar {
/* @apply flex flex-col md:grid md:grid-cols-2 gap-4 md:items-center justify-between pb-12; */
@apply pb-12 grid gap-8 gap-y-8 items-end;
grid-template-columns: max-content 1fr;
.post-count {
@apply flex items-end gap-2 col-span-1;
&__count {
@apply font-normal uppercase fjalla;
line-height: 0.8;
}
&__text {
@apply text-lg nunito;
}
}
.search-bar {
@apply md:justify-self-end text-primary relative w-full md:max-w-[500px];
&:after {
@apply absolute top-1/2 -translate-y-1/2;
content: '';
right: 10px;
display: flex;
width: 30px;
height: 30px;
background-image: url('../resources/img/icons/carhop-rechercher-green-circle.svg');
background-repeat: no-repeat;
background-position: center center;
background-size: contain;
}
input {
@apply w-full !py-4 px-4 border border-primary rounded-full text-base;
padding-right: 33px;
line-height: 1.5;
height: auto;
&::placeholder {
@apply !text-base font-normal text-carhop-green-700;
}
}
}
select {
@apply w-full md:w-auto border border-carhop-green-700 text-carhop-green-700 rounded-full !py-4 px-4 max-w-full text-base;
line-height: 1.5;
height: auto;
appearance: none; /* Disable the default arrow */
-webkit-appearance: none; /* For WebKit-based browsers */
-moz-appearance: none; /* For Firefox */
background-color: #fff;
background-image: url('../resources/img/elements/select-drop-button.svg');
background-repeat: no-repeat;
background-position: right 10px center;
background-size: 30px;
cursor: pointer;
}
select[name='sort_by'] {
@apply pr-12 w-fit justify-self-end col-span-1;
}
}
.search-by {
@apply col-span-2 md:col-span-1;
&__label {
@apply text-primary font-semibold nunito;
}
.search-by__buttons {
@apply flex items-center border border-primary border-solid w-fit;
button {
@apply block font-normal nunito text-primary py-3 px-4;
&[aria-selected='true'] {
@apply bg-primary text-white;
&:hover {
@apply bg-primary text-white;
}
}
&:hover {
@apply bg-carhop-green-50;
}
}
&[data-filter='thematique'] {
}
}
}
&__toolbar-actions {
@apply flex flex-wrap md:items-center gap-4 w-full md:justify-start col-span-2 md:col-span-1;
select[name='etiquettes'] {
/* @apply bg-blue-300; */
}
select[name='auteurs'] {
/* @apply bg-red-300; */
}
}
&__list {
@apply grid grid-cols-1 lg:grid-cols-2 gap-8;
}
}
body:has(.search-by button[data-filter='thematique'][aria-selected='true']) {
.post-grid__toolbar-actions {
select[name='auteurs'],
.search-bar {
@apply hidden;
}
}
}
body:has(.search-by button[data-filter='auteur'][aria-selected='true']) {
.post-grid__toolbar-actions {
select[name='etiquettes'],
.search-bar {
@apply hidden;
}
}
}
body:has(.search-by button[data-filter='occurence'][aria-selected='true']) {
.post-grid__toolbar-actions {
select[name='etiquettes'],
select[name='auteurs'] {
@apply hidden;
}
}
}

View File

@ -0,0 +1,18 @@
.post-type-archive-analyses-etudes {
.latest-parutions {
@apply grid grid-cols-1 gap-6 -mt-12 max-w-screen-lg mx-auto;
&__title {
@apply text-white;
}
}
.post-grid {
@apply alignwide !mx-auto !mt-12;
select[name='types'] {
@apply pr-20;
}
.content-section__inner {
@apply p-0;
}
}
}

View File

@ -0,0 +1,18 @@
body.archive {
.latest-parutions {
@apply grid grid-cols-1 gap-6 -mt-12 max-w-screen-lg mx-auto;
&__title {
@apply text-white;
}
}
.post-grid {
@apply alignwide !mx-auto !mt-12;
select[name='types'] {
@apply pr-20;
}
.content-section__inner {
@apply p-0;
}
}
}

View File

@ -0,0 +1,5 @@
<svg width="50" height="50" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="50" height="50" fill="white"/>
<path d="M22.0689 11.3378H9.17236V24.112H22.0689V11.3378Z" stroke="#136F63" stroke-width="2"/>
<path d="M40.8277 24.1119H27.9312V40.37H40.8277V24.1119Z" stroke="#136F63" stroke-width="2"/>
</svg>

After

Width:  |  Height:  |  Size: 336 B

View File

@ -0,0 +1,15 @@
<svg width="50" height="50" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="50" height="50" fill="white"/>
<g clip-path="url(#clip0_2897_15196)">
<path d="M35.914 27.7796H13.9587V42.1057H35.914V27.7796Z" stroke="#136F63" stroke-width="2"/>
<path d="M38.0925 20.6612H11.9077V27.7796H38.0925V20.6612Z" stroke="#136F63" stroke-width="2"/>
<path d="M24.9319 15.4477V9" stroke="#136F63" stroke-width="2"/>
<path d="M33.0369 16.7801L37.6566 12.2194" stroke="#136F63" stroke-width="2"/>
<path d="M16.8178 16.7265L12.198 12.1657" stroke="#136F63" stroke-width="2"/>
</g>
<defs>
<clipPath id="clip0_2897_15196">
<rect width="28" height="34" fill="white" transform="translate(11 9)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 735 B

View File

@ -0,0 +1,87 @@
<?php
$analyses_etudes_posts = new WP_Query(array(
'post_type' => 'analyses-etudes',
'posts_per_page' => -1
));
$post_count = $analyses_etudes_posts->post_count;
$authors = get_posts(array(
'post_type' => 'auteurs',
'posts_per_page' => -1
));
$types = get_terms(array(
'taxonomy' => 'type',
'hide_empty' => true,
));
?>
<section class="post-grid content-section">
<h2 class="find-publication__title title-small">Trouver une publication</h2>
<div class="content-section__inner">
<div class="post-grid__toolbar">
<div class="search-by">
<p class="search-by__label">Filtrer par</p>
<div class="search-by__buttons" data-filter="thematique">
<button data-filter="thematique" aria-selected="true">Thématique</button>
<button data-filter="occurence" aria-selected="false">Mot clé</button>
</div>
</div>
<div class="post-grid__toolbar-actions" data-post-type="revues">
<div class="search-bar">
<input type="text" placeholder="<?php _e('Rechercher par mot-clé', 'dynamiques'); ?>">
</div>
<select name="types">
<option value=""><?php _e('Tous les types', 'carhop'); ?></option>
<?php foreach ($types as $type) : ?>
<option value="<?php echo $type->slug; ?>" <?php selected($type_slug, $type->slug); ?>>
<?php echo $type->name; ?>
</option>
<?php endforeach; ?>
</select>
<select name="auteurs">
<option value=""><?php _e('Tous·tes les 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>
</div>
<h2 class="post-count">
<span class="post-count__count">
<?php echo $post_count; ?>
</span>
<span class="post-count__text">
<?php _e('revues', 'dynamiques'); ?>
</span>
</h2>
<select name="sort_by">
<option value="date_desc" selected><?php _e('Numéros récents en premier', 'dynamiques'); ?></option>
<option value="date_asc"><?php _e('Numéros anciens en premier', 'dynamiques'); ?></option>
<option value="title_asc"><?php _e('Par ordre alphabétique', 'dynamiques'); ?></option>
</select>
</div>
<ul class="post-grid__list">
<?php if (isset($analyses_etudes_posts) && $analyses_etudes_posts->have_posts()) : ?>
<?php while ($analyses_etudes_posts->have_posts()) : $analyses_etudes_posts->the_post(); ?>
<?php get_template_part('template-parts/analyses-etudes/card-analyse-etude', null, array(
'ID' => get_the_ID(),
)); ?>
<?php endwhile; ?>
<?php endif; ?>
</div>
</section>

View File

@ -0,0 +1,15 @@
<?php get_template_part('template-parts/page-header', null, array(
'title' => 'Analyses et études',
'subtitle' => 'Accédez à nos recherches et publications thématiques',
'description' => 'Le CARHOP produit des analyses et des études ancrées dans lhistoire sociale, en lien étroit avec les réalités du monde du travail et des mouvements sociaux. Ces productions visent à éclairer lactualité par une lecture historique, critique et accessible.',
'cover' => array(
'url' => get_stylesheet_directory_uri() . '/resources/img/covers/carhop-page-analyses-etudes-cover.svg',
'alt' => 'Revues'
),
'has_overlap' => true,
'background_style' => 'sliced',
'cta' => array(
'title' => __('Trouver une publication', 'carhop'),
'url' => '#prochaines-publications',
)
));

View File

@ -0,0 +1,42 @@
<?php
$ID = $args['ID'] ?? null;
$types_terms = get_the_terms($ID, 'type');
$type = isset($types_terms[0]) ? $types_terms[0] : null;
$title = get_the_title($ID);
$excerpt = get_the_excerpt($ID);
$link = get_the_permalink($ID);
$image = get_the_post_thumbnail_url($ID);
$date = get_the_date('F Y', $ID);
$author = get_the_author_meta('display_name', get_the_author_meta('ID', $ID));
$author_link = get_the_author_link($ID);
$author_avatar = get_avatar_url(get_the_author_meta('ID', $ID));
$numerotation = get_post_meta($ID, 'post_numerotation', true);
?>
<div class="post-card post-card--analyses-etudes card">
<?php if ($type) : ?>
<div class="content-meta">
<span class="content-meta__type content-meta__type--revue"><?php echo $type->name; ?></span>
<p class="content-meta__revue-issue content-meta__revue-issue--green">
<span class="revue-issue-number revue-meta__label sr-only">Numéro</span>
<?php echo $numerotation; ?>
</p>
</div>
<?php endif; ?>
<div class="card__inner">
<div class="card__content">
<h3 class="card__title"><?php echo $title; ?></h3>
<div class="card__excerpt"><?php echo $excerpt; ?></div>
</div>
<div class="card__details">
<p class="card__details-text"><?php echo $excerpt; ?></p>
<time datetime="<?php echo $date; ?>" class="card__details-date date"><?php echo $date; ?></time>
</div>
</div>
</div>

View File

@ -0,0 +1,58 @@
<?php
?>
<div class="post-grid__toolbar post-toolbar toolbar-analyses-etudes">
<div class="search-by">
<p class="search-by__label">Filtrer par</p>
<div class="search-by__buttons" data-filter="thematique">
<button data-filter="thematique" aria-selected="true">Thématique</button>
<button data-filter="auteur" aria-selected="false">Auteur·e</button>
<button data-filter="occurence" aria-selected="false">Mot clé</button>
</div>
</div>
<div class="post-grid__toolbar-actions" data-post-type="articles">
<div class="search-bar">
<input type="text" placeholder="<?php _e('Rechercher par mot-clé', 'dynamiques'); ?>">
</div>
<select name="etiquettes">
<option value=""><?php _e('Tous les tags', 'dynamiques'); ?></option>
<?php foreach ($thematiques as $thematique) : ?>
<option value="<?php echo $thematique->slug; ?>" <?php selected($etiquette_slug, $thematique->slug); ?>>
<?php echo $thematique->name; ?>
</option>
<?php endforeach; ?>
</select>
<select name="auteurs">
<option value=""><?php _e('Tous·tes les 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>
</div>
<h2 class="post-count">
<span class="post-count__count">
<?php echo $post_count; ?>
</span>
<span class="post-count__text">
<?php _e('articles', 'dynamiques'); ?>
</span>
</h2>
<select name="sort_by">
<option value="date_desc" selected><?php _e('Numéros récents en premier', 'dynamiques'); ?></option>
<option value="date_asc"><?php _e('Numéros anciens en premier', 'dynamiques'); ?></option>
<option value="title_asc"><?php _e('Par ordre alphabétique', 'dynamiques'); ?></option>
</select>
</div>

View File

@ -0,0 +1,42 @@
<?php
$post_amount = $args['post_amount'] ?? 1;
$post_type = $args['post_type'] ?? null;
if (!$post_type) return;
$posts_query = new WP_Query(array(
'post_type' => $post_type,
'posts_per_page' => $post_amount,
'orderby' => 'date',
'order' => 'DESC',
));
$posts = $posts_query->posts;
$current_post_type = $args['current_post_type'] ?? get_post_type();
?>
<div class="latest-parutions">
<?php if ($post_amount > 1) : ?>
<h2 class="latest-parutions__title title-small">Dernières parutions</h2>
<?php else : ?>
<h2 class="latest-parutions__title title-small">Dernière parution</h2>
<?php endif; ?>
<?php foreach ($posts as $post) : ?>
<div class="post-card post-card--analyses-etudes">
<div class="latest-parution__item">
<?php get_template_part('template-parts/components/content-meta', null, array(
'current_post_type' => $current_post_type,
'current_post_id' => $post->ID
)); ?>
<a href="<?php echo get_the_permalink($post->ID); ?>">
<?php echo get_the_post_thumbnail($post->ID, 'medium'); ?>
<h3><?php echo get_the_title($post->ID); ?></h3>
</a>
</div>
</div>
<?php endforeach; ?>
</div>

View File

@ -0,0 +1,93 @@
<?php
$post_amount = $args['post_amount'] ?? -1;
$grid_title = $args['grid_title'] ?? 'Trouver une publication';
$current_post_type = $args['current_post_type'] ?? get_post_type();
$current_post_type_obj = get_post_type_object($current_post_type);
$posts_query = new WP_Query(array(
'post_type' => $current_post_type,
'posts_per_page' => $post_amount
));
$post_count = $posts_query->post_count;
$types = get_terms(array(
'taxonomy' => 'type',
'hide_empty' => true,
));
// write_log($current_post_type_obj);
?>
<section class="post-grid content-section">
<h2 class="find-publication__title title-small"><?php echo $grid_title; ?></h2>
<div class="content-section__inner">
<div class="post-grid__toolbar">
<div class="search-by">
<p class="search-by__label">Filtrer par</p>
<div class="search-by__buttons" data-filter="thematique">
<button data-filter="thematique" aria-selected="true">Thématique</button>
<button data-filter="occurence" aria-selected="false">Mot clé</button>
</div>
</div>
<div class="post-grid__toolbar-actions" data-post-type="revues">
<div class="search-bar">
<input type="text" placeholder="<?php _e('Rechercher par mot-clé', 'dynamiques'); ?>">
</div>
<select name="types">
<option value=""><?php _e('Tous les types', 'carhop'); ?></option>
<?php foreach ($types as $type) : ?>
<option value="<?php echo $type->slug; ?>" <?php selected($type_slug, $type->slug); ?>>
<?php echo $type->name; ?>
</option>
<?php endforeach; ?>
</select>
<select name="auteurs">
<option value=""><?php _e('Tous·tes les 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>
</div>
<h2 class="post-count">
<span class="post-count__count">
<?php echo $post_count; ?>
</span>
<?php if ($post_amount > 1) : ?>
<span class="post-count__text">
<?php echo $current_post_type_obj->labels->name; ?>
</span>
<?php else : ?>
<span class="post-count__text">
<?php echo $current_post_type_obj->labels->singular_name; ?>
</span>
<?php endif; ?>
</h2>
<select name="sort_by">
<option value="date_desc" selected><?php _e('Numéros récents en premier', 'dynamiques'); ?></option>
<option value="date_asc"><?php _e('Numéros anciens en premier', 'dynamiques'); ?></option>
<option value="title_asc"><?php _e('Par ordre alphabétique', 'dynamiques'); ?></option>
</select>
</div>
<ul class="post-grid__list">
<?php if (isset($posts_query) && $posts_query->have_posts()) : ?>
<?php while ($posts_query->have_posts()) : $posts_query->the_post(); ?>
<?php get_template_part('template-parts/components/post-card', null, array(
'ID' => get_the_ID(),
)); ?>
<?php endwhile; ?>
<?php endif; ?>
</div>
</section>

View File

@ -0,0 +1,28 @@
<?php
$current_post_id = $args['current_post_id'] ?? get_the_ID();
$current_post_type = $args['current_post_type'] ?? null;
$type = null;
$current_post_type_supports_type = is_object_in_taxonomy($current_post_type, 'type');
if ($current_post_type_supports_type) {
$type = get_the_terms($current_post_id, taxonomy: 'type') ?? null;
// $current_post_type === 'analyses-etudes' && is_array($type) && !empty($type) && isset($type[0]->name
} else {
$current_post_type_obj = get_post_type_object($current_post_type);
$type = $current_post_type_obj->labels->singular_name;
}
?>
<div class="content-meta">
<?php if ($type) : ?>
<span class="content-meta__type content-meta__type--revue"><?php echo $type ?></span>
<?php endif; ?>
<p class="content-meta__revue-issue content-meta__revue-issue--green">
<span class="revue-issue-number revue-meta__label sr-only">Numéro</span>
28
</p>
</div>

View File

@ -0,0 +1,44 @@
<?php
$ID = $args['ID'] ?? null;
$current_post_type = $args['current_post_type'] ?? get_post_type();
$types_terms = get_the_terms($ID, 'type');
$type = isset($types_terms[0]) ? $types_terms[0] : null;
$title = get_the_title($ID);
$excerpt = get_the_excerpt($ID);
$link = get_the_permalink($ID);
$image = get_the_post_thumbnail_url($ID);
$date = get_the_date('F Y', $ID);
$authors = get_field('authors', $ID);
$numerotation = get_post_meta($ID, 'post_numerotation', true);
?>
<div class="post-card post-card--<?php echo $current_post_type; ?> card">
<?php get_template_part('template-parts/components/content-meta', null, array(
'current_post_type' => $current_post_type,
'current_post_id' => $ID
)); ?>
<div class="card__inner">
<div class="card__content">
<h3 class="card__title"><?php echo $title; ?></h3>
<div class="card__excerpt"><?php echo $excerpt; ?></div>
</div>
<div class="card__details">
<time datetime="<?php echo $date; ?>" class="card__details-date date"><?php echo $date; ?></time>
<?php if ($authors) : ?>
<ul class="post-card__authors">
<?php foreach ($authors as $author) : ?>
<li class="author"><?php echo $author->post_title; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
</div>
</div>

View File

@ -0,0 +1,7 @@
<?php
$block_content = '<!-- wp:carhop-blocks/subscribe-infolettre {"title":"Restez connectés à lhistoire sociale","className":"wp-block-carhop-blocks-subscribe-infolettre subscribe-infolettre"} -->
<!-- wp:paragraph {"placeholder":"Description","className":"subscribe-infolettre__description"} -->
<p class="subscribe-infolettre__description">Recevez les dernières actualités du CARHOP et la revue Dynamiques directement dans votre boîte mail. Abonnez-vous et surveillez votre boîte : un mail de confirmation vous attend ! </p>
<!-- /wp:paragraph -->
<!-- /wp:carhop-blocks/subscribe-infolettre -->';
echo do_blocks($block_content);

View File

@ -0,0 +1,15 @@
<?php get_template_part('template-parts/page-header', null, array(
'title' => 'Expositions',
'subtitle' => 'Découvrez nos expositions thématiques',
'description' => 'Le CARHOP conçoit et diffuse des expositions ancrées dans lhistoire sociale, en lien étroit avec le monde du travail, les luttes collectives et les réalités contemporaines. Pensées comme des outils de transmission et de sensibilisation, elles rendent visibles des récits, des archives et des parcours souvent absents des discours dominants.',
'cover' => array(
'url' => get_stylesheet_directory_uri() . '/resources/img/covers/carhop-page-analyses-etudes-cover.svg',
'alt' => 'Revues'
),
'has_overlap' => true,
'background_style' => 'sliced',
'cta' => array(
'title' => __('Trouver une exposition', 'carhop'),
'url' => '#prochaines-expositions',
)
));

View File

@ -0,0 +1,15 @@
<?php get_template_part('template-parts/page-header', null, array(
'title' => 'Outils pédagogiques',
'subtitle' => 'Transmettre lhistoire sociale autrement',
'description' => 'Le CARHOP développe des outils pédagogiques à partir de ses recherches, de ses archives et de ses expositions. Pensés pour les enseignant·es, formateur·rices, animateur·rices et publics variés, ces supports facilitent lappropriation de lhistoire sociale et ouvrent le débat sur les enjeux dhier et daujourdhui.',
'cover' => array(
'url' => get_stylesheet_directory_uri() . '/resources/img/covers/carhop-page-analyses-etudes-cover.svg',
'alt' => 'Revues'
),
'has_overlap' => true,
'background_style' => 'sliced',
'cta' => array(
'title' => __('Trouver un outil pédagogique', 'carhop'),
'url' => '#next-outils-pedagogiques',
)
));

View File

@ -6,9 +6,10 @@ $description = $args['description'];
$cover = $args['cover']; $cover = $args['cover'];
$background_style = $args['background_style'] ?? 'normal'; $background_style = $args['background_style'] ?? 'normal';
$cta = $args['cta']; $cta = $args['cta'];
$has_overlap = $args['has_overlap'] ?? false;
?> ?>
<section class="page-header content-section content-section--full-width page-header--<?php echo $background_style; ?>-background"> <section class="page-header content-section content-section--full-width page-header--<?php echo $background_style; ?>-background <?php echo $has_overlap ? 'page-header--has-overlap' : ''; ?>">
<div class="content-section__inner page-header__inner"> <div class="content-section__inner page-header__inner">
<div class="page-header__content"> <div class="page-header__content">
<h1 class="page-header__title title-small "><?php echo $title; ?></h1> <h1 class="page-header__title title-small "><?php echo $title; ?></h1>