Compare commits
24 Commits
ed7cb381b5
...
01a6145310
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01a6145310 | ||
|
|
46151d30c7 | ||
|
|
8c9d64ea93 | ||
|
|
35ea1baad5 | ||
|
|
9b95fcb9e6 | ||
|
|
64059074e9 | ||
|
|
934df0011f | ||
|
|
3bf452a5f2 | ||
|
|
4201c8d86b | ||
|
|
a9467c2ce2 | ||
|
|
44a6c0ef03 | ||
|
|
95f21975bc | ||
|
|
3aeefe4fb6 | ||
|
|
16932f76d7 | ||
|
|
6ec182d740 | ||
|
|
52f988c72d | ||
|
|
cea500ceda | ||
|
|
f3ea7af3e3 | ||
|
|
a047bb51f3 | ||
|
|
8f047cd85d | ||
|
|
7621066e00 | ||
|
|
c3333cf403 | ||
|
|
757d5e9581 | ||
|
|
f25803a972 |
50
archive-actualites.php
Normal file
50
archive-actualites.php
Normal 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/post-types/actualites/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();
|
||||
|
|
@ -17,67 +17,15 @@
|
|||
)
|
||||
)); ?>
|
||||
|
||||
<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
|
||||
<?php get_template_part('template-parts/components/archive/latest-parutions', null, array(
|
||||
'post_amount' => 1,
|
||||
'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>
|
||||
|
||||
|
||||
<!-- #### ANALYSES ET ETUDES POST GRID #### -->
|
||||
<?php get_template_part('template-parts/analyses-etudes/analyses-etudes-grid'); ?>
|
||||
<?php get_template_part('template-parts/post-types/analyses-etudes/analyses-etudes-grid'); ?>
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ $current_post_type = get_post_type();
|
|||
?>
|
||||
|
||||
<main id="content" class="site-content flex-grow">
|
||||
<?php get_template_part('template-parts/expositions/archive-header'); ?>
|
||||
<?php get_template_part('template-parts/post-types/expositions/archive-header'); ?>
|
||||
|
||||
|
||||
<!-- #### LATEST PARUTIONS #### -->
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ $current_post_type = get_post_type();
|
|||
?>
|
||||
|
||||
<main id="content" class="site-content flex-grow">
|
||||
<?php get_template_part('template-parts/outils-pedagogiques/archive-header'); ?>
|
||||
<?php get_template_part('template-parts/post-types/outils-pedagogiques/archive-header'); ?>
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,9 +7,7 @@
|
|||
function wrap_parent_menu_item_buttons($output, $item, $depth, $args)
|
||||
{
|
||||
|
||||
|
||||
// #### MENU HOMEGRADE HEADER
|
||||
if ($args->theme_location === "secondary" && in_array('menu-item-has-children', $item->classes, true)) {
|
||||
if ($args->theme_location === "secondary" && in_array('menu-item-has-children', $item->classes, true) && $depth === 0) {
|
||||
$output = '<button type="button" class="menu-item__submenu-toggle" aria-expanded="false" aria-controls="sub-menu-' . $item->ID . '">' . $item->title . '</button>';
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -22,23 +20,36 @@ function wrap_parent_menu_item_buttons($output, $item, $depth, $args)
|
|||
|
||||
|
||||
|
||||
if ($args->theme_location === "primary" && !in_array('menu-item-has-children', $item->classes, true) && $depth === 1) {
|
||||
|
||||
if (!in_array('menu-item-has-children', $item->classes, true) && $depth === 1) {
|
||||
$page_icon = get_field('page_icon', $item->object_id) ?? null;
|
||||
$icon_html = isset($page_icon) && is_array($page_icon) && !empty($page_icon['url']) ? '<img class="page_icon" src="' . $page_icon['url'] . '" alt=""/>' : '';
|
||||
|
||||
|
||||
$page_subtitle = get_field('page_subtitle', $item->object_id) ?? '';
|
||||
$subtitle_html = '<span class="page_subtitle">' . $page_subtitle . '</span>';
|
||||
|
||||
|
||||
if ($item->url === 'https://carhop.local/a-propos/equipe/') {
|
||||
write_log($item);
|
||||
write_log($subtitle_html);
|
||||
write_log($icon_html);
|
||||
// $icon_html = get_archive_page_icon_html($item->object);
|
||||
// $subtitle_html = get_archive_page_subtitle_html($item->object);
|
||||
}
|
||||
if ($item->type === 'post_type_archive') {
|
||||
$icon_html = get_archive_page_icon_html($item->object);
|
||||
$subtitle_html = get_archive_page_subtitle_html($item->object);
|
||||
}
|
||||
|
||||
if ($item->ID === 494) {
|
||||
write_log($item);
|
||||
}
|
||||
|
||||
|
||||
$output = '<a href="' . $item->url . '">' . $icon_html . '<div class="menu-item__content-inner"><span class="menu-item__title">' . $item->title . '</span>' . $subtitle_html . '</div></a>';
|
||||
$output = '<a href="' . $item->url . '" class="menu-item__content">' . $icon_html . '<div class="menu-item__content-inner"><p class="menu-item__title">' . $item->title . '</p>' . $subtitle_html . '</div></a>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
add_filter('walker_nav_menu_start_el', 'wrap_parent_menu_item_buttons', 10, 4);
|
||||
|
|
@ -92,6 +103,7 @@ function carhop_add_submenu_item_icon($output, $item, $depth, $args)
|
|||
{
|
||||
// Only for submenu items (depth >= 1
|
||||
if (!isset($args->theme_location) || $args->theme_location !== 'secondary' || $depth < 1 || !function_exists('get_field')) {
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -102,19 +114,18 @@ function carhop_add_submenu_item_icon($output, $item, $depth, $args)
|
|||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$icon_html = '';
|
||||
$excerpt_html = '';
|
||||
$subtitle_html = '';
|
||||
// Attachment array with ID (ACF image field)
|
||||
if (is_array($pageIcon) && isset($pageIcon['url'])) {
|
||||
$icon_html = '<img src="' . esc_url($pageIcon['url']) . '" class="menu-item__icon-img" alt="" aria-hidden="true" />';
|
||||
}
|
||||
|
||||
if (has_excerpt($item->object_id)) {
|
||||
$excerpt_html = '<p class="menu-item__excerpt">' . get_the_excerpt($item->object_id) . '</p>';
|
||||
if (page_has_subtitle($item->object_id)) {
|
||||
$page_subtitle = get_field('page_subtitle', $item->object_id);
|
||||
$subtitle_html = '<span class="page_subtitle">' . $page_subtitle . '</span>';
|
||||
}
|
||||
|
||||
|
||||
return '<a class="menu-item__content" href="' . $item->url . '">' . $icon_html . '<div class="menu-item__content-inner"><p class="menu-item__title">' . $item->title . '</p>' . $excerpt_html . '</div></a>';
|
||||
return '<a class="menu-item__content" href="' . $item->url . '">' . $icon_html . '<div class="menu-item__content-inner"><p class="menu-item__title">' . $item->title . '</p>' . $subtitle_html . '</div></a>';
|
||||
}
|
||||
add_filter('walker_nav_menu_start_el', 'carhop_add_submenu_item_icon', 15, 4);
|
||||
|
|
|
|||
|
|
@ -3,31 +3,14 @@
|
|||
// 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;
|
||||
}
|
||||
// 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;
|
||||
// }
|
||||
// handle_posts_numerotation_remapping('analyses-etudes');
|
||||
// }
|
||||
|
||||
$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');
|
||||
// add_action('save_post', 'handle_posts_analyses_etudes_numerotation_remapping');
|
||||
// add_action('delete_post', 'handle_posts_analyses_etudes_numerotation_remapping');
|
||||
|
|
|
|||
17
includes/posts-save.php
Normal file
17
includes/posts-save.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
|
||||
function handle_posts_numerotation_remapping_on_save()
|
||||
{
|
||||
$post_type = get_post_type();
|
||||
|
||||
$numerotated_post_types = array('analyses-etudes', 'expositions', 'outils-pedagogiques', 'recherches');
|
||||
// Ne s'exécuter que dans l'admin pour éviter de surcharger le frontend
|
||||
if (!is_admin() || !in_array($post_type, $numerotated_post_types)) {
|
||||
return;
|
||||
}
|
||||
handle_posts_numerotation_remapping($post_type);
|
||||
}
|
||||
|
||||
add_action('save_post', 'handle_posts_numerotation_remapping_on_save');
|
||||
add_action('delete_post', 'handle_posts_numerotation_remapping_on_save');
|
||||
|
|
@ -39,12 +39,18 @@ function get_archive_page_icon_html($post_type)
|
|||
return '<img class="page_icon" src="' . get_template_directory_uri() . '/resources/img/icons/icon-expositions.svg" alt="Expositions" />';
|
||||
case 'outils-pedagogiques':
|
||||
return '<img class="page_icon" src="' . get_template_directory_uri() . '/resources/img/icons/icon-outils-pedagogiques.svg" alt="Outils pédagogiques" />';
|
||||
case 'actualites':
|
||||
return '<img class="page_icon" src="' . get_template_directory_uri() . '/resources/img/icons/icon-actualites.svg" alt="Actualités" />';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function page_has_subtitle($page_id)
|
||||
{
|
||||
$has_page_subtitle = get_field('page_subtitle', $page_id) ? true : false;
|
||||
return $has_page_subtitle;
|
||||
}
|
||||
function get_archive_page_subtitle_html($post_type)
|
||||
{
|
||||
switch ($post_type) {
|
||||
|
|
@ -56,10 +62,35 @@ function get_archive_page_subtitle_html($post_type)
|
|||
return '<span class="page_subtitle">Découvrez nos expositions passées et actuelles.</span>';
|
||||
case 'revues':
|
||||
return '<span class="page_subtitle">Accédez à nos revues et publications</span> ';
|
||||
case 'actualites':
|
||||
return '<span class="page_subtitle">Suivez nos projets, événements et publications.</span> ';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function handle_posts_numerotation_remapping($post_type)
|
||||
{
|
||||
if (!is_admin()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$query = new WP_Query(array(
|
||||
'post_type' => $post_type,
|
||||
'posts_per_page' => -1,
|
||||
'orderby' => 'date',
|
||||
'order' => 'ASC',
|
||||
));
|
||||
$numerotation = 0;
|
||||
while ($query->have_posts()) {
|
||||
$query->the_post();
|
||||
$numerotation++;
|
||||
update_post_meta(get_the_ID(), 'post_numerotation', $numerotation);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function hasPostTypeNumerotation($post_type)
|
||||
{
|
||||
switch ($post_type) {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,13 @@
|
|||
|
||||
@apply bg-no-repeat bg-center;
|
||||
|
||||
&.is-style-has-overlap {
|
||||
@apply pb-64 !-mb-48;
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
background-size: 100% 100%;
|
||||
a,
|
||||
h1,
|
||||
|
|
|
|||
|
|
@ -1,46 +1,69 @@
|
|||
.author-card {
|
||||
@apply bg-white p-8 border border-carhop-green-700 mb-0 flex flex-col;
|
||||
@apply grid w-full border border-primary p-6 mb-12 items-center bg-white;
|
||||
grid-template-columns: auto 1fr;
|
||||
gap: 1rem;
|
||||
|
||||
&--director {
|
||||
@apply bg-primary;
|
||||
p,
|
||||
.author-card__name a,
|
||||
.author-card__bio {
|
||||
@apply text-white;
|
||||
}
|
||||
transition: all 0.3s ease-in-out;
|
||||
|
||||
.author-card__email {
|
||||
@apply bg-white text-primary;
|
||||
&:hover {
|
||||
@apply bg-carhop-green-900;
|
||||
}
|
||||
}
|
||||
@apply translate-y-[-4px];
|
||||
}
|
||||
|
||||
&__profile-picture {
|
||||
@apply w-full h-40 object-cover mb-6 border border-carhop-green-700 relative bg-white;
|
||||
@apply w-32 h-32 object-cover p-2 border border-primary;
|
||||
|
||||
img {
|
||||
@apply w-full h-full object-cover;
|
||||
}
|
||||
&-placeholder {
|
||||
@apply bg-carhop-green-100 flex items-center justify-center;
|
||||
|
||||
&:before {
|
||||
content: '';
|
||||
@apply block w-6 h-6 filter-primary;
|
||||
background-image: url('../resources/img/icons/icon-losange.svg');
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat !important;
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
&__name {
|
||||
@apply text-2xl font-medium !mb-0 !pb-0 uppercase text-primary;
|
||||
a {
|
||||
@apply !text-primary;
|
||||
&--1n:before {
|
||||
background-image: url('../resources/img/icons/icon-losange.svg');
|
||||
}
|
||||
&--2n:before {
|
||||
background-image: url('../resources/img/icons/icon-rectangle-rotated.svg');
|
||||
}
|
||||
&--3n:before {
|
||||
background-image: url('../resources/img/icons/icon-circle.svg');
|
||||
}
|
||||
&--4n:before {
|
||||
background-image: url('../resources/img/icons/icon-rectangle-vertical.svg');
|
||||
}
|
||||
}
|
||||
&-placeholder {
|
||||
@apply w-full h-full bg-carhop-green-100 relative;
|
||||
}
|
||||
}
|
||||
|
||||
&__email {
|
||||
@apply mt-8 text-lg !normal-case mx-auto;
|
||||
|
||||
&:is(a) {
|
||||
@apply !text-primary;
|
||||
&__infos {
|
||||
@apply w-full flex flex-col gap-y-2;
|
||||
.author-card__name {
|
||||
@apply text-2xl uppercase font-medium tracking-normal;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
@apply !text-white;
|
||||
.author-card__articles-amount {
|
||||
@apply text-primary font-normal flex items-center gap-2;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
@apply block w-6 h-6 bg-no-repeat bg-center;
|
||||
background-image: url('../resources/img/icons/icon-activites.svg');
|
||||
background-size: contain;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__bio {
|
||||
@apply text-base text-primary text-center leading-relaxed;
|
||||
&__description {
|
||||
@apply col-span-2;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,21 @@
|
|||
@apply translate-x-2;
|
||||
}
|
||||
}
|
||||
&--download {
|
||||
@apply bg-transparent filter-primary border-none px-0 py-6;
|
||||
&:after {
|
||||
content: none !important;
|
||||
}
|
||||
|
||||
img {
|
||||
@apply w-20;
|
||||
transition: transform 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
&:hover img {
|
||||
@apply translate-y-2;
|
||||
}
|
||||
}
|
||||
|
||||
&--has-icon {
|
||||
@apply flex items-center gap-4;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@
|
|||
&:before {
|
||||
@apply content-[''] mr-2 h-6 w-6 inline-block;
|
||||
}
|
||||
&--analyses-etudes:before,
|
||||
&--expositions:before,
|
||||
&--outils-pedagogiques:before,
|
||||
&--revues:before,
|
||||
&--revue:before {
|
||||
@apply rounded-full bg-carhop-orange-400;
|
||||
|
|
|
|||
10
resources/css/components/content-wrapper.css
Normal file
10
resources/css/components/content-wrapper.css
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
.content-wrapper {
|
||||
@apply max-w-screen-2xl w-full px-8;
|
||||
@apply mx-auto grid gap-12 lg:py-12 py-6 items-start;
|
||||
|
||||
grid-template-columns: 1fr 2fr;
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
.author-card {
|
||||
@apply grid w-full border border-primary p-6 mb-12 items-center;
|
||||
grid-template-columns: min-content 1fr;
|
||||
gap: 1rem;
|
||||
|
||||
transition: all 0.3s ease-in-out;
|
||||
|
||||
&:hover {
|
||||
@apply translate-y-[-4px];
|
||||
}
|
||||
|
||||
&__profile-picture {
|
||||
@apply w-32 h-32 object-cover p-2 border border-primary;
|
||||
|
||||
img {
|
||||
@apply w-full h-full object-cover;
|
||||
/* filter: grayscale(100%); */
|
||||
}
|
||||
&-placeholder {
|
||||
@apply bg-carhop-green-100 flex items-center justify-center;
|
||||
|
||||
&:before {
|
||||
content: '';
|
||||
@apply block w-6 h-6 filter-primary;
|
||||
background-image: url('../resources/img/icons/icon-losange.svg');
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat !important;
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
&--1n:before {
|
||||
background-image: url('../resources/img/icons/icon-losange.svg');
|
||||
}
|
||||
&--2n:before {
|
||||
background-image: url('../resources/img/icons/icon-rectangle-rotated.svg');
|
||||
}
|
||||
&--3n:before {
|
||||
background-image: url('../resources/img/icons/icon-circle.svg');
|
||||
}
|
||||
&--4n:before {
|
||||
background-image: url('../resources/img/icons/icon-rectangle-vertical.svg');
|
||||
}
|
||||
}
|
||||
&-placeholder {
|
||||
@apply w-full h-full bg-carhop-green-100 relative;
|
||||
|
||||
/* &:after {
|
||||
@apply content-[''] block w-6 h-6 bg-carhop-green-700 rounded-full absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2;
|
||||
} */
|
||||
}
|
||||
}
|
||||
|
||||
&__infos {
|
||||
@apply w-full flex flex-col gap-y-2;
|
||||
.author-card__name {
|
||||
@apply text-2xl uppercase font-medium tracking-normal;
|
||||
}
|
||||
|
||||
.author-card__articles-amount {
|
||||
@apply text-primary font-normal flex items-center gap-2;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
@apply block w-6 h-6 bg-no-repeat bg-center;
|
||||
background-image: url('../resources/img/icons/icon-activites.svg');
|
||||
background-size: contain;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__description {
|
||||
@apply col-span-2;
|
||||
}
|
||||
}
|
||||
51
resources/css/components/member-card.css
Normal file
51
resources/css/components/member-card.css
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
.member-card {
|
||||
@apply bg-white p-8 border border-carhop-green-700 mb-0 flex flex-col items-center;
|
||||
gap: 1rem;
|
||||
&--director {
|
||||
@apply bg-primary;
|
||||
p,
|
||||
.member-card__name a,
|
||||
.member-card__bio {
|
||||
@apply text-white;
|
||||
}
|
||||
|
||||
.member-card__email {
|
||||
@apply bg-white text-primary;
|
||||
&:hover {
|
||||
@apply bg-carhop-green-900;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__profile-picture {
|
||||
@apply w-full h-40 object-cover mb-6 relative bg-white p-2 border border-primary;
|
||||
|
||||
img {
|
||||
@apply w-full h-full object-cover;
|
||||
/* filter: grayscale(100%); */
|
||||
}
|
||||
}
|
||||
|
||||
&__name {
|
||||
@apply text-2xl font-medium !mb-0 !pb-0 uppercase text-primary;
|
||||
a {
|
||||
@apply !text-primary;
|
||||
}
|
||||
}
|
||||
|
||||
&__email {
|
||||
@apply mt-8 text-lg !normal-case mx-auto;
|
||||
|
||||
&:is(a) {
|
||||
@apply !text-primary;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
@apply !text-white;
|
||||
}
|
||||
}
|
||||
|
||||
&__bio {
|
||||
@apply text-base text-primary text-center leading-relaxed;
|
||||
}
|
||||
}
|
||||
16
resources/img/carhop-fleche-full-90.svg
Normal file
16
resources/img/carhop-fleche-full-90.svg
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg id="fleche-full" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 77 77">
|
||||
<!-- Generator: Adobe Illustrator 30.2.1, SVG Export Plug-In . SVG Version: 2.1.1 Build 1) -->
|
||||
<defs>
|
||||
<style>
|
||||
.st0 {
|
||||
fill: none;
|
||||
stroke: #000;
|
||||
stroke-width: 2px;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<path class="st0" d="M39.5,50.8v-23.1"/>
|
||||
<path class="st0" d="M25.4,36.1l14.2,14.7,14.2-14.7"/>
|
||||
<circle class="st0" cx="38.5" cy="38.5" r="37.5"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 522 B |
10
resources/img/icons/carhop-bookmark.svg
Normal file
10
resources/img/icons/carhop-bookmark.svg
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<svg width="13" height="20" viewBox="0 0 13 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_2405_26614)">
|
||||
<path d="M0.84375 0.829102V17.9601L6.50327 12.2802L12.1543 17.5372V0.829102H0.84375Z" stroke="#136F63" stroke-width="2"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_2405_26614">
|
||||
<rect width="13" height="20" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 373 B |
12
resources/img/icons/carhop-plume2.svg
Normal file
12
resources/img/icons/carhop-plume2.svg
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_2405_26651)">
|
||||
<path d="M22.669 4.49756L20.455 6.01463V14.1473L6.59375 21.9112L8.27783 6.73449L15.5617 2.8496L15.6795 0.0236816" stroke="#136F63" stroke-width="2"/>
|
||||
<path d="M6.59375 21.9113L12.3349 13.2253" stroke="#136F63" stroke-width="2"/>
|
||||
<path d="M0 22.405H6.59498" stroke="#136F63" stroke-width="2"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_2405_26651">
|
||||
<rect width="23" height="23" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 544 B |
15
resources/img/icons/icon-actualites.svg
Normal file
15
resources/img/icons/icon-actualites.svg
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<svg width="34" height="34" viewBox="0 0 34 34" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="34" height="34" fill="white"/>
|
||||
<g clip-path="url(#clip0_3384_16263)">
|
||||
<path d="M14.0774 4.6579H7.67334V10.9145H14.0774V4.6579Z" stroke="#136F63" stroke-width="2"/>
|
||||
<path d="M24.9999 19.0921H10.0234" stroke="#136F63" stroke-width="2"/>
|
||||
<path d="M24.9999 27.3421H10.0234" stroke="#136F63" stroke-width="2"/>
|
||||
<path d="M20.8315 14.9737H10.0234" stroke="#136F63" stroke-width="2"/>
|
||||
<path d="M20.8315 23.2171H10.0234" stroke="#136F63" stroke-width="2"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_3384_16263">
|
||||
<rect width="18" height="24" fill="white" transform="translate(7 4)"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 700 B |
|
|
@ -1,5 +1,5 @@
|
|||
export default function alternatePictures() {
|
||||
const images = document.querySelectorAll('.wp-block-image.is-style-framed');
|
||||
const images = document.querySelectorAll('.wp-block-image.is-style-framed-rotated');
|
||||
|
||||
images.forEach((img, index) => {
|
||||
if (index % 2 === 0) {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import handleScrollTop from './utilities/scroll-top';
|
|||
import handleInsidePageScrolling from './page-scrolling';
|
||||
import alternatePictures from './alternate-pictures';
|
||||
import { searchBarInit } from './search-bar';
|
||||
import singlesInit from './singles/singles';
|
||||
|
||||
window.addEventListener('load', function () {
|
||||
menuInit();
|
||||
|
|
@ -12,4 +13,5 @@ window.addEventListener('load', function () {
|
|||
handleInsidePageScrolling();
|
||||
alternatePictures();
|
||||
searchBarInit();
|
||||
singlesInit();
|
||||
});
|
||||
|
|
|
|||
34
resources/js/singles/post-toolbar.ts
Normal file
34
resources/js/singles/post-toolbar.ts
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
export function handlePostToolbar() {
|
||||
observeTabsButtons();
|
||||
}
|
||||
|
||||
function observeTabsButtons(): void {
|
||||
const toolbarButtons = document.querySelectorAll('#post-toolbar button[role="tab"]');
|
||||
if (!toolbarButtons) return;
|
||||
|
||||
toolbarButtons.forEach((toolbarButton) => {
|
||||
toolbarButton.addEventListener('click', () => {
|
||||
const currentTabValue = toolbarButton.getAttribute('data-tab') as string;
|
||||
toggleActiveTab(toolbarButton as HTMLElement);
|
||||
handleActiveTabContent(currentTabValue as string);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function toggleActiveTab(toolbarButton: HTMLElement): void {
|
||||
resetActiveToolbarButtons();
|
||||
toolbarButton.setAttribute('aria-selected', 'true');
|
||||
}
|
||||
|
||||
function resetActiveToolbarButtons(): void {
|
||||
const toolbarButtons = document.querySelectorAll('#post-toolbar button[role="tab"]');
|
||||
if (!toolbarButtons) return;
|
||||
toolbarButtons.forEach((toolbarButton) => {
|
||||
toolbarButton.setAttribute('aria-selected', 'false');
|
||||
});
|
||||
}
|
||||
|
||||
function handleActiveTabContent(tab: string): void {
|
||||
const contentWrapper = document.querySelector('.content-wrapper');
|
||||
contentWrapper?.setAttribute('data-active-tab', tab);
|
||||
}
|
||||
5
resources/js/singles/singles.ts
Normal file
5
resources/js/singles/singles.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import { handlePostToolbar } from './post-toolbar.ts';
|
||||
|
||||
export default function singles(): void {
|
||||
handlePostToolbar();
|
||||
}
|
||||
151
single-auteurs.php
Normal file
151
single-auteurs.php
Normal file
|
|
@ -0,0 +1,151 @@
|
|||
<?php
|
||||
get_header();
|
||||
$author_id = get_the_ID();
|
||||
|
||||
$description = get_field('description', $author_id);
|
||||
$profilePicture = get_field('profile_thumbnail', $author_id);
|
||||
$profilePictureUrl = $profilePicture['url'] ?? '';
|
||||
$profilePictureAlt = $profilePicture['alt'] ?? '';
|
||||
$comity = get_field('comity', $author_id);
|
||||
$authorPublicationsAmount = get_author_publications_amount($author_id);
|
||||
|
||||
|
||||
$is_carhop_member = get_field('is_carhop_member', $author_id);
|
||||
$carhop_member_id = get_field('carhop_member', $author_id);
|
||||
|
||||
if ($is_carhop_member && isset($carhop_member_id)) {
|
||||
switch_to_blog(1);
|
||||
$description = get_field('description', $carhop_member_id);
|
||||
$comity = get_field('comity', $carhop_member_id);
|
||||
restore_current_blog();
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<div class="page--single-auteurs" data-author-id="<?php echo $author_id; ?>">
|
||||
|
||||
<?php if (have_posts()) : ?>
|
||||
<?php while (have_posts()) : the_post(); ?>
|
||||
<div class="page--single-auteurs__header">
|
||||
|
||||
<div class="inner container">
|
||||
<div class="author-card__profile-picture">
|
||||
<div class="profile-picture-container">
|
||||
<?php if ($profilePictureUrl) : ?>
|
||||
<img src="<?php echo $profilePictureUrl; ?>" alt="<?php echo $profilePictureAlt; ?>">
|
||||
<?php else : ?>
|
||||
<div class="author-card__profile-picture-placeholder">
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="background-picture"></div>
|
||||
</div>
|
||||
|
||||
<div class="author-card__content">
|
||||
<p class="page--single-auteurs__subinfo sub-infos">
|
||||
<span class="data-type">Auteur·e</span>
|
||||
|
||||
<?php if ($authorPublicationsAmount) : ?>
|
||||
<span class="articles-amount">
|
||||
<?php echo $authorPublicationsAmount; ?>
|
||||
<?php echo get_current_blog_id() === 1 ? 'publications' : 'articles'; ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
<h1 class="page--single-auteurs__title"><?php the_title(); ?></h1>
|
||||
<div class="infos">
|
||||
<p><?php echo $description; ?></p>
|
||||
<?php if ($comity) : ?>
|
||||
<p class="page--single-auteurs__comities-list">
|
||||
|
||||
<?php foreach ($comity as $comity_value) : ?>
|
||||
<?php
|
||||
$comities = get_field_object('comity');
|
||||
$comity_label = $comities['choices'][$comity_value] ?? null;
|
||||
|
||||
?>
|
||||
<?php if ($comity_label) : ?>
|
||||
<span class="page--single-auteurs__comity page--single-auteurs__comity--<?php echo $comity_value ?>"><?php echo $comity_label ?></span>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="page--single-auteurs__latest-publication">
|
||||
|
||||
<p>Dernière publication</p>
|
||||
<?php
|
||||
$latestArticle = get_posts(array(
|
||||
'post_type' => 'articles',
|
||||
'posts_per_page' => 1,
|
||||
'orderby' => 'date',
|
||||
'order' => 'DESC',
|
||||
'post_not_in' => array(913),
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => 'authors',
|
||||
'value' => $author_id,
|
||||
'compare' => 'LIKE'
|
||||
)
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
if (isset($latestArticle[0])) : ?>
|
||||
|
||||
<?php
|
||||
get_template_part('template-parts/dynamiques/article-card', null, array(
|
||||
'ID' => $latestArticle[0]->ID,
|
||||
'showCover' => true,
|
||||
));
|
||||
|
||||
?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
$authorArticles = get_posts(array(
|
||||
'post_type' => 'articles',
|
||||
'posts_per_page' => -1,
|
||||
'post__not_in' => array($latestArticle[0]->ID),
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => 'authors', // Ajustez selon votre structure
|
||||
'value' => $author_id,
|
||||
'compare' => 'LIKE'
|
||||
)
|
||||
),
|
||||
));
|
||||
?>
|
||||
|
||||
<ul class="post-grid__list">
|
||||
<?php foreach ($authorArticles as $article) : ?>
|
||||
<?php get_template_part('template-parts/articles/card-article', null, array(
|
||||
'ID' => $article->ID,
|
||||
'showAuthors' => true,
|
||||
)); ?>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<?php endwhile; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
get_footer();
|
||||
53
single.php
53
single.php
|
|
@ -1,40 +1,39 @@
|
|||
<?php get_header(); ?>
|
||||
|
||||
<div class="container my-8 mx-auto">
|
||||
|
||||
<?php
|
||||
$postType = get_post_type();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<div class="page-single page--single-<?php echo $postType; ?>" data-article-id="<?php echo get_the_ID(); ?>">
|
||||
<?php if (have_posts()) : ?>
|
||||
<?php while (have_posts()) : the_post(); ?>
|
||||
<?php get_template_part('template-parts/components/posts/post-header'); ?>
|
||||
|
||||
<?php
|
||||
while (have_posts()) :
|
||||
the_post();
|
||||
?>
|
||||
<?php get_template_part('template-parts/components/posts/post-toolbar'); ?>
|
||||
|
||||
<div class="content-wrapper" data-active-tab="post">
|
||||
<aside class="sidebar">
|
||||
<?php get_template_part('template-parts/components/posts/post-tags'); ?>
|
||||
</aside>
|
||||
|
||||
<div class="content-area">
|
||||
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<?php get_template_part('template-parts/components/posts/post-content', null, array(
|
||||
'ID' => get_the_ID()
|
||||
)); ?>
|
||||
|
||||
<header class="entry-header mb-4">
|
||||
<?php the_title(sprintf('<h1 class="entry-title text-2xl lg:text-5xl font-extrabold leading-tight mb-1"><a href="%s" rel="bookmark">', esc_url(get_permalink())), '</a></h1>'); ?>
|
||||
<time datetime="<?php echo get_the_date('c'); ?>" itemprop="datePublished" class="text-sm text-gray-700"><?php echo get_the_date(); ?></time>
|
||||
</header>
|
||||
|
||||
<div class="entry-content">
|
||||
<?php the_content(); ?>
|
||||
|
||||
<?php
|
||||
wp_link_pages(
|
||||
array(
|
||||
'before' => '<div class="page-links"><span class="page-links-title">' . __('Pages:', 'tailpress') . '</span>',
|
||||
'after' => '</div>',
|
||||
'link_before' => '<span>',
|
||||
'link_after' => '</span>',
|
||||
'pagelink' => '<span class="screen-reader-text">' . __('Page', 'tailpress') . ' </span>%',
|
||||
'separator' => '<span class="screen-reader-text">, </span>',
|
||||
)
|
||||
);
|
||||
?>
|
||||
<?php get_template_part('template-parts/components/posts/post-authors', null, array(
|
||||
'postId' => get_the_ID()
|
||||
)); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</article>
|
||||
|
||||
|
||||
|
||||
<?php endwhile; ?>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,12 @@ $posts_query = new WP_Query(array(
|
|||
'order' => 'DESC',
|
||||
|
||||
));
|
||||
|
||||
if ($post_type === 'analyses-etudes') :
|
||||
$posts_query = get_last_analyses_etudes_posts();
|
||||
endif;
|
||||
|
||||
|
||||
$posts = $posts_query->posts;
|
||||
$current_post_type = $args['current_post_type'] ?? get_post_type();
|
||||
|
||||
|
|
@ -24,8 +30,8 @@ $current_post_type = $args['current_post_type'] ?? get_post_type();
|
|||
<?php endif; ?>
|
||||
|
||||
<?php foreach ($posts as $post) : ?>
|
||||
<?php get_template_part('template-parts/components/post-card', null, array(
|
||||
'ID' => get_the_ID(),
|
||||
<?php get_template_part('template-parts/components/cards/post-card', null, array(
|
||||
'ID' => $post->ID,
|
||||
)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
19
template-parts/components/posts/post-authors.php
Normal file
19
template-parts/components/posts/post-authors.php
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<div id="post-authors" class="post-authors">
|
||||
|
||||
<?php get_template_part('template-parts/authors/authors-list', null, array(
|
||||
'postId' => get_the_ID()
|
||||
)); ?>
|
||||
|
||||
<?php
|
||||
// get_template_part('template-parts/authors/authors-last-publications', null, array(
|
||||
// 'postId' => get_the_ID()
|
||||
// ));
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
19
template-parts/components/posts/post-content.php
Normal file
19
template-parts/components/posts/post-content.php
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
$articleID = $args['ID'];
|
||||
$articleContent = get_the_content($articleID);
|
||||
$articleTitle = get_the_title($articleID);
|
||||
$citeReference = get_field('cite_reference', $articleID);
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<article class="post-content entry-content">
|
||||
|
||||
<?php the_content(); ?>
|
||||
|
||||
<?php if ($citeReference) : ?>
|
||||
<p id="cite-reference">
|
||||
<?php echo $citeReference; ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</article>
|
||||
103
template-parts/components/posts/post-header.php
Normal file
103
template-parts/components/posts/post-header.php
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
<?php
|
||||
$currentPostType = get_post_type();
|
||||
$post_id = get_the_ID();
|
||||
|
||||
$postTitle = get_the_title($post_id);
|
||||
$hasNumerotation = hasPostTypeNumerotation($post_id);
|
||||
$hasThumbnail = has_post_thumbnail();
|
||||
$authors = get_field('authors', $ID);
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<?php if ($hasNumerotation) : ?>
|
||||
<?php
|
||||
$numerotation = get_post_meta($current_post_id, 'post_numerotation', true); ?>
|
||||
<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>
|
||||
<?php endif; ?>
|
||||
|
||||
<section class="post-header post-header--<?php echo $post_type; ?> ">
|
||||
<div class="post-header__inner post-header__inner--<?php echo $hasThumbnail ? 'has-thumbnail' : 'no-thumbnail'; ?> ">
|
||||
|
||||
<?php if ($hasThumbnail) : ?>
|
||||
<div class="thumbnail-wrapper">
|
||||
<?php
|
||||
$focal_position = safe_get_thumbnail_focal_point_css();
|
||||
the_post_thumbnail('full', [
|
||||
'class' => 'thumbnail',
|
||||
'style' => 'object-fit: cover; object-position: ' . esc_attr($focal_position) . ';'
|
||||
]);
|
||||
?>
|
||||
<div class="thumbnail-overlay"></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="content">
|
||||
|
||||
|
||||
<?php get_template_part('template-parts/components/content-meta', null, array(
|
||||
'current_post_id' => $post_id,
|
||||
'current_post_type' => $post_type
|
||||
)); ?>
|
||||
|
||||
<h1 class="post-header__title"> <?php echo $postTitle; ?></h1>
|
||||
<?php if ($authors && is_array($authors) && count($authors) > 0) : ?>
|
||||
<a class="post-header__main-author" href="<?php echo get_the_permalink($authors[0]->ID); ?>">
|
||||
<?php echo $authors[0]->post_title; ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="post-details">
|
||||
|
||||
<div class="post-meta">
|
||||
<div class="post-date-info">
|
||||
<p class="post-details__label">Parution</p>
|
||||
<time class="post-details__value" datetime="<?php echo get_the_date('Y-m-d', $currentRevueID); ?>"><?php echo get_the_date('d F Y', $currentRevueID); ?></time>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="socials-buttons">
|
||||
<?php
|
||||
$shareUrls = build_share_urls();
|
||||
?>
|
||||
<button class="socials-buttons__button socials-buttons__button--cite" <?php echo empty($citeReference) ? 'disabled' : ''; ?> title="<?php echo empty($citeReference) ? 'Citation non disponible' : 'Copier la citation'; ?>">
|
||||
<img src="<?php echo get_template_directory_uri(); ?>/resources/img/icons/carhop-citer-article.svg" alt="">
|
||||
Citer
|
||||
</button>
|
||||
<button class="socials-buttons__button socials-buttons__button--like is-disabled" data-likes-count="<?php echo $likes_count; ?>">
|
||||
<img src="<?php echo get_template_directory_uri(); ?>/resources/img/icons/carhop-soutenir.svg" alt="">
|
||||
<span class="likes-count"><?php echo $likes_count; ?></span>
|
||||
<span class="button-action-text">J'aime</span>
|
||||
|
||||
</button>
|
||||
<button class="socials-buttons__button socials-buttons__button--share" data-share-url="<?php echo get_the_permalink(); ?>">
|
||||
<img class="share-icon" src="<?php echo get_template_directory_uri(); ?>/resources/img/icons/carhop-partager-social.svg" alt="">
|
||||
Partager
|
||||
<ul class="socials-buttons__share-links">
|
||||
<li class="share-button share-button--facebook">
|
||||
<a href='<?php echo $shareUrls['Facebook'] ?>' class="share-link" target="_blank" title="<?php echo __("Partager ce contenu sur ", "dynamiques") . "Facebook" ?>">
|
||||
<img class="social-icon" src="<?php echo get_template_directory_uri() . '/resources/img/icons/carhop-social-facebook.svg' ?>" alt="">
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="share-button share-button--linkedin">
|
||||
<a href='<?php echo $shareUrls['Linkedin'] ?>' class="share-link" target="_blank" title="<?php echo __("Partager ce contenu sur ", "dynamiques") . "LinkedIn" ?>">
|
||||
<img class="social-icon" src="<?php echo get_template_directory_uri() . '/resources/img/icons/carhop-social-linkedin.svg' ?>" alt="">
|
||||
</a>
|
||||
</li>
|
||||
<li class="share-button share-button--copy-link">
|
||||
<a class="share-link share-link--copy" data-url="<?php echo get_the_permalink(); ?>" title="<?php echo __("Copier le lien", "dynamiques") ?>">
|
||||
<img class="social-icon" src="<?php echo get_template_directory_uri() . '/resources/img/icons/carhop-social-lien.svg' ?>" alt="">
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
19
template-parts/components/posts/post-tags.php
Normal file
19
template-parts/components/posts/post-tags.php
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
$postID = get_the_ID();
|
||||
$etiquettes = get_the_terms($postID, 'etiquettes');
|
||||
|
||||
if (empty($etiquettes)) return;
|
||||
?>
|
||||
|
||||
<div id="post-tags" class="post-tags">
|
||||
<div class="tags">
|
||||
<h3 class="tags__title">Tags</h3>
|
||||
<ul class="tags-list">
|
||||
<?php foreach ($etiquettes as $etiquette) : ?>
|
||||
<li class="post-tag">
|
||||
<a href="<?php echo get_term_link($etiquette); ?>"><?php echo $etiquette->name; ?></a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
50
template-parts/components/posts/post-toolbar.php
Normal file
50
template-parts/components/posts/post-toolbar.php
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
$id = get_the_ID();
|
||||
$reference = get_field('references', $id);
|
||||
$hasReferences = isset($reference) && is_array($reference) && count($reference) > 0;
|
||||
$authors = get_field('authors', $id);
|
||||
$hasAuthors = isset($authors) && is_array($authors) && count($authors) > 0;
|
||||
|
||||
$pdf_version = get_field('pdf_version', $id);
|
||||
$pdf_url = isset($pdf_version) && !empty($pdf_version['url']) ? $pdf_version['url'] : null;
|
||||
?>
|
||||
|
||||
<div id="post-toolbar" class="post-toolbar">
|
||||
<div role="tablist" aria-labelledby="tablist-1" class="tablist">
|
||||
<button id="tab-1" type="button" role="tab" aria-selected="true" aria-controls="tabpanel-1" data-tab="post">
|
||||
<img class="icon" src="<?php echo get_stylesheet_directory_uri(); ?>/resources/img/icons/carhop-document.svg" alt="">
|
||||
<span>Résumé</span>
|
||||
</button>
|
||||
<?php if ($hasAuthors) : ?>
|
||||
<button id="tab-2" type="button" role="tab" aria-selected="false" aria-controls="tabpanel-2" tabindex="-1" data-tab="authors">
|
||||
<img class="icon" src="<?php echo get_stylesheet_directory_uri(); ?>/resources/img/icons/carhop-plume.svg" alt="">
|
||||
<span>Auteur·e·s</span>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
|
||||
<button id="tab-3" type="button" role="tab" aria-selected="false" aria-controls="tabpanel-5" tabindex="-1" data-tab="informations">
|
||||
<img class="icon" src="<?php echo get_stylesheet_directory_uri(); ?>/resources/img/icons/carhop-note-biographique.svg" alt="">
|
||||
<span>Informations</span>
|
||||
</button>
|
||||
|
||||
<div class="toolbar-actions">
|
||||
|
||||
<?php if ($pdf_url) : ?>
|
||||
<a href="<?php echo $pdf_url; ?>" target="_blank" class="cta cta--classic cta--has-icon cta--rounded cta--download-pdf ">
|
||||
<img class="icon" src="<?php echo get_template_directory_uri(); ?>/resources/img/icons/carhop-fleche-telecharger.svg" alt="">
|
||||
PDF
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<button id="listen-article" type="button" data-reading-status="stopped" title="Lancer la lecture vocale de l'article">
|
||||
<img id="play-reading" class="icon" src="<?php echo get_stylesheet_directory_uri(); ?>/resources/img/icons/carhop-ecouter.svg" alt="Lecture vocale de l'article">
|
||||
<img id="pause-reading" class="icon" src="<?php echo get_stylesheet_directory_uri(); ?>/resources/img/icons/carhop-pause.svg" alt="Arrêter la lecture vocale de l'article">
|
||||
</button>
|
||||
<button id="stop-reading" type="button" title="Arrêter la lecture vocale de l'article">
|
||||
<img class="icon" src="<?php echo get_stylesheet_directory_uri(); ?>/resources/img/icons/carhop-stop-reading.svg" alt="Arrêter la lecture vocale de l'article">
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
18
template-parts/post-types/actualites/archive-header.php
Normal file
18
template-parts/post-types/actualites/archive-header.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
$block_content = '<!-- wp:front-header/front-header -->
|
||||
<section class="wp-block-front-header-front-header alignfull block-front-header"><div class="front-header__innerblocks"><!-- wp:carhop-blocks/heading -->
|
||||
<div class="wp-block-carhop-blocks-heading carhop-heading carhop-heading--hierarchy-classic"><div class="carhop-heading__innerblocks"><!-- wp:heading {"textAlign":"center","level":1,"style":{"elements":{"link":{"color":{"text":"var:preset|color|light"}}}},"textColor":"light"} -->
|
||||
<h1 class="wp-block-heading has-text-align-center has-light-color has-text-color has-link-color">historique</h1>
|
||||
<!-- /wp:heading -->
|
||||
|
||||
<!-- wp:paragraph {"align":"center","style":{"elements":{"link":{"color":{"text":"var:preset|color|light"}}}},"textColor":"light"} -->
|
||||
<p class="has-text-align-center has-light-color has-text-color has-link-color">Des origines militantes à la mémoire collective</p>
|
||||
<!-- /wp:paragraph --></div></div>
|
||||
<!-- /wp:carhop-blocks/heading -->
|
||||
|
||||
<!-- wp:paragraph {"align":"center"} -->
|
||||
<p class="has-text-align-center">L’équipe du CARHOP réunit des professionnel·le·s aux compétences variées – archivistique, recherche, animation, édition, informatique, administration – qui travaillent ensemble pour collecter, préserver et valoriser la mémoire ouvrière et sociale.</p>
|
||||
<!-- /wp:paragraph --></div></section>
|
||||
<!-- /wp:front-header/front-header -->';
|
||||
echo do_blocks($block_content);
|
||||
Loading…
Reference in New Issue
Block a user