Compare commits

..

No commits in common. "8ef34620b76be505876ba2dd72ed4025a3857fd5" and "01a61453103de604d7d59ba0a06f97601db63f86" have entirely different histories.

33 changed files with 53 additions and 960 deletions

View File

@ -15,7 +15,7 @@ require_once(__DIR__ . '/includes/rapport-activites.php');
require_once(__DIR__ . '/includes/equipe.php'); require_once(__DIR__ . '/includes/equipe.php');
require_once(__DIR__ . '/includes/navwalker.php'); require_once(__DIR__ . '/includes/navwalker.php');
require_once(__DIR__ . '/includes/post-type-analyses-etudes.php'); require_once(__DIR__ . '/includes/post-type-analyses-etudes.php');
require_once(__DIR__ . '/includes/posts-save.php');
// require_once(__DIR__ . '/includes/widget.php'); // require_once(__DIR__ . '/includes/widget.php');
// require_once( __DIR__ . '/includes/taxonomy.php'); // require_once( __DIR__ . '/includes/taxonomy.php');
// require_once( __DIR__ . '/includes/errorlog.php'); // require_once( __DIR__ . '/includes/errorlog.php');

View File

@ -104,172 +104,3 @@ function hasPostTypeNumerotation($post_type)
return false; return false;
} }
} }
/**
* Retourne une WP_Query avec la dernière analyse et la dernière étude (une de chaque type).
* Utilisable comme une query classique (->posts, ->post_count, etc.).
*/
function get_last_analyses_etudes_posts()
{
$latest_analyse = get_posts(array(
'posts_per_page' => 1,
'post_status' => 'publish',
'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,
'post_status' => 'publish',
'post_type' => 'analyses-etudes',
'orderby' => 'date',
'order' => 'DESC',
'tax_query' => array(
array(
'taxonomy' => 'type',
'field' => 'slug',
'terms' => 'etude',
),
),
));
$post_ids = array_merge(
array_map(function ($p) {
return $p->ID;
}, $latest_analyse),
array_map(function ($p) {
return $p->ID;
}, $latest_etude)
);
$post_ids = array_filter(array_unique($post_ids));
if (empty($post_ids)) {
return new WP_Query(array(
'post_type' => 'analyses-etudes',
'posts_per_page' => 0,
));
}
return new WP_Query(array(
'post_type' => 'analyses-etudes',
'post__in' => $post_ids,
'orderby' => 'post__in',
'posts_per_page' => count($post_ids),
));
}
/**
* Récupère le nombre de likes d'un post
*
* Cette fonction utilitaire récupère le compteur de likes stocké
* dans les métadonnées d'un post. Retourne 0 si aucun like n'existe.
*
* @param int $post_id L'ID du post
* @return int Le nombre de likes (0 si aucun)
*/
function get_post_likes_count($post_id)
{
$likes_count = get_post_meta($post_id, 'likes_count', true);
return $likes_count ? intval($likes_count) : 0;
}
/**
* Affiche le nombre de likes d'un post avec formatage
*
* Cette fonction utilitaire formate l'affichage du compteur de likes
* avec une icône optionnelle et la gestion du pluriel.
*
* @param int $post_id L'ID du post
* @param bool $show_icon Afficher l'icône cœur (défaut: true)
* @return string Le texte formaté (ex: "❤️ 5 likes" ou "3 like")
*/
function display_likes_count($post_id, $show_icon = true)
{
$likes_count = get_post_likes_count($post_id);
$icon = $show_icon ? '❤️ ' : '';
return $icon . $likes_count . ' like' . ($likes_count > 1 ? 's' : '');
}
/**
* Construit les URL de partage pour un post
*
* Cette fonction génère les URL de partage pour un post spécifique.
* Elle retourne un tableau associatif contenant les URL de partage pour Facebook, Twitter-X et LinkedIn.
*
* @return array Tableau associatif contenant les URL de partage
*/
function build_share_urls()
{
$post_id = get_the_ID();
$postUrl = get_permalink($post_id);
$postTitle = get_the_title($post_id);
$facebookUrl = 'https://www.facebook.com/sharer.php?u=' . $postUrl;
$twitterUrl = 'https://twitter.com/intent/tweet?text=' . $postTitle . '&url=' . get_the_permalink(get_the_id());
$linkedInUrl = 'https://www.linkedin.com/feed/?shareActive=true&text=' . $postTitle . ' ' . $postUrl;
return array(
'Facebook' => $facebookUrl,
'Twitter-X' => $twitterUrl,
'Linkedin' => $linkedInUrl,
'postUrl' => $postUrl
);
}
function get_author_publications_amount($authorID)
{
if (empty($authorID)) return 0;
if (get_current_blog_id() === 1) {
$posts = count_user_posts_by_author($authorID, array('expositions', 'outils-pedagogiques', 'analyses-etudes'));
return $posts;
}
if (get_current_blog_id() === 2) {
$posts = count_user_posts_by_author($authorID, 'articles');
return $posts;
}
return;
}
/**
* Compte le nombre d'articles d'un utilisateur pour un type de post donné
*
* Cette fonction compte combien d'articles d'un type spécifique
* sont associés à un utilisateur donné via le champ custom 'authors'.
*
* @param int $userID L'ID de l'utilisateur
* @param string $postType Le type de post à compter (ex: 'articles')
* @return int Le nombre d'articles trouvés
*/
function count_user_posts_by_author($userID, $postType)
{
$args = array(
'post_type' => $postType,
'meta_query' => array(
array(
'key' => 'authors',
'value' => '"' . $userID . '"',
'compare' => 'LIKE',
),
),
);
$query = new WP_Query($args);
return $query->found_posts;
}

View File

@ -35,17 +35,10 @@
@import './components/member-author-card.css'; @import './components/member-author-card.css';
@import './components/search-module.css'; @import './components/search-module.css';
@import './components/author-card.css'; @import './components/author-card.css';
@import './components/member-card.css';
@import './components/tablist.css'; @import './components/tablist.css';
@import './components/post-card.css'; @import './components/post-card.css';
@import './components/post-grid.css'; @import './components/post-grid.css';
@import './components/card-analyse-etude.css'; @import './components/card-analyse-etude.css';
@import './components/post-header.css';
@import './components/post-toolbar.css';
@import './components/listen-article.css';
@import './components/post-tag.css';
@import './components/content-wrapper.css';
@import './components/content-area.css';
/* ########### EDITOR CONTENT ############ */ /* ########### EDITOR CONTENT ############ */
@import './editor-content/entry-content.css'; @import './editor-content/entry-content.css';
@ -65,8 +58,6 @@
@import './pages/archive-dbmob.css'; @import './pages/archive-dbmob.css';
@import './pages/archive-analyses-etudes.css'; @import './pages/archive-analyses-etudes.css';
@import './pages/archives.css'; @import './pages/archives.css';
@import './pages/singles.css';
@import './pages/single-auteurs.css';
/* ########### BLOCKS ############ */ /* ########### BLOCKS ############ */
@import './blocks/blocks-spacing.css'; @import './blocks/blocks-spacing.css';

View File

@ -108,9 +108,6 @@
p { p {
@apply text-primary text-lg; @apply text-primary text-lg;
} }
> :last-child {
@apply !mb-0 !pb-0;
}
} }
.narrative-card__content h1, .narrative-card__content h1,
.narrative-card__content h2, .narrative-card__content h2,

View File

@ -33,12 +33,6 @@
&__list { &__list {
@apply grid grid-cols-1 md:grid-cols-2 gap-8; @apply grid grid-cols-1 md:grid-cols-2 gap-8;
.communique-card { .communique-card {
&__inner {
@apply flex items-start justify-between gap-8;
}
.cta--download {
@apply shrink-0 py-0;
}
h3 { h3 {
@apply mb-6 text-2xl; @apply mb-6 text-2xl;
} }

View File

@ -1,4 +1,3 @@
.wp-block-image.is-style-framed-rotated,
.wp-block-image.is-style-framed { .wp-block-image.is-style-framed {
@apply border-2 p-4 w-fit bg-white; @apply border-2 p-4 w-fit bg-white;
--advised-text-color: currentColor; --advised-text-color: currentColor;
@ -14,7 +13,6 @@
@apply -rotate-2; @apply -rotate-2;
} }
} }
.wp-block-image.is-style-stacked { .wp-block-image.is-style-stacked {
@apply w-fit bg-green-200 relative z-30 !mb-12; @apply w-fit bg-green-200 relative z-30 !mb-12;
@ -38,8 +36,7 @@
@apply content-[''] absolute inset-0 bg-white border border-primary w-full h-full top-0 left-0; @apply content-[''] absolute inset-0 bg-white border border-primary w-full h-full top-0 left-0;
z-index: 10; z-index: 10;
transform: translate(40px, 40px) rotate(-4deg); transform: translate(40px, 40px) rotate(-4deg);
background: background: linear-gradient(
linear-gradient(
var(--wp--preset--color--primary), var(--wp--preset--color--primary),
var(--wp--preset--color--primary) var(--wp--preset--color--primary)
) )

View File

@ -1,48 +0,0 @@
.content-area {
@apply max-w-screen-2xl mx-auto w-full;
.edito {
@apply border border-primary p-6 mb-12;
summary {
cursor: pointer;
@apply relative;
&::marker {
content: none;
}
&::after {
@apply absolute top-1/2 right-0 -translate-y-1/2;
transition: transform 0.3s ease-out;
background-image: url('../resources/img/elements/select-drop-button.svg');
/* background-image: url('../resources/img/icons/icon-activites.svg'); */
content: ' ';
@apply bg-contain;
/* @apply bg-red-500; */
@apply block w-12 h-12;
@apply rounded-full;
@apply mr-2;
}
}
&[open] {
summary::after {
transform: rotate(-180deg) translateY(50%);
}
}
&__title {
@apply text-3xl font-bold;
}
&__content {
@apply text-lg mt-6;
}
&__cta {
@apply my-4;
}
}
.table-matieres {
&__title {
@apply text-4xl font-bold mb-12;
}
.article-grid__list {
@apply grid grid-cols-1 gap-4;
}
}
}

View File

@ -1,50 +0,0 @@
#listen-article,
#stop-reading {
@apply rounded-full w-12 h-12 flex items-center justify-center m-0 p-0 transition-all duration-300;
}
#listen-article {
@apply bg-primary text-white;
&:hover {
@apply scale-110;
}
img {
@apply w-6 h-6;
}
&[data-reading-status='playing'] {
/* @apply bg-blue-500; */
@apply bg-white border border-primary;
/* &:hover {
@apply bg-red-500;
} */
#play-reading {
@apply hidden;
}
#pause-reading {
@apply block;
}
}
&[data-reading-status='stopped'] {
#play-reading {
@apply block;
}
#pause-reading {
@apply hidden;
}
}
&[data-reading-status='paused'] {
@apply bg-yellow-500;
#play-reading {
@apply block;
}
#pause-reading {
@apply hidden;
}
}
}
#stop-reading {
@apply bg-primary hidden;
img {
@apply w-4 h-4;
}
}

View File

@ -1,10 +1,5 @@
.post-card { .post-card {
@apply bg-white border border-primary p-6; @apply bg-white border border-primary p-6;
transition: transform 0.3s ease-out;
&:hover {
transform: translateY(-4px);
}
h3.card__title { h3.card__title {
@apply mb-6; @apply mb-6;
} }
@ -38,30 +33,11 @@
@apply text-lg flex items-center gap-2; @apply text-lg flex items-center gap-2;
&::before { &::before {
@apply w-6 h-6 block bg-no-repeat bg-center bg-contain; @apply w-6 h-6 block rounded-full bg-no-repeat bg-center bg-contain;
content: ''; content: '';
background-image: url('../resources/img/icons/carhop-plume.svg');
@apply filter-primary; @apply filter-primary;
} }
&.author::before {
background-image: url('../resources/img/icons/carhop-plume2.svg');
}
&.editor::before {
background-image: url('../resources/img/icons/carhop-bookmark.svg');
}
}
}
&__details-text {
@apply flex flex-col gap-2;
}
.tag-list {
@apply flex flex-wrap gap-2 mt-4;
&__tag {
@apply text-primary bg-white border border-solid border-primary px-4 py-2;
&:hover {
@apply bg-primary text-white;
}
} }
} }
} }

View File

@ -1,268 +0,0 @@
.post-header {
@apply bg-primary text-white py-8 2xl:py-16 px-2 lg:px-4 md:px-8 overflow-x-hidden;
h1.post-header__title,
h2.post-header__title {
@apply uppercase font-medium text-4xl md:text-5xl lg:text-5xl text-white;
line-height: 1.2;
}
&__main-author {
@apply text-white font-light tracking-wide flex items-center gap-3 mt-4;
&::before {
@apply w-6 h-6 block bg-no-repeat bg-center bg-contain;
content: '';
background-image: url('../resources/img/icons/carhop-plume2.svg');
filter: invert(1) brightness(0) saturate(100%) invert(100%);
}
&:hover {
@apply underline underline-offset-8;
}
}
&__inner {
@apply mx-auto grid gap-24;
@screen xl {
@apply container;
}
@apply max-w-screen-2xl mx-auto;
&--has-thumbnail {
@screen lg {
grid-template-columns: 4fr 1fr;
}
}
&--no-thumbnail {
grid-template-columns: 1fr;
}
}
.content-meta__revue-issue {
@apply bg-white !text-primary;
}
.content-meta__type {
@apply text-white;
}
.thumbnail-wrapper {
@apply order-2 lg:order-1 relative z-20 h-fit;
width: calc(100% - 40px);
padding: 1.2rem;
/* max-width: calc(70% - 40px);
@apply mx-auto; */
@screen lg {
/* transform: translateX(-10px); */
}
&:before {
content: '';
@apply bg-white block absolute top-0 left-0 border border-carhop-green-700 w-full h-full z-10;
}
img {
aspect-ratio: 4/5;
/* max-height: 200px; */
@apply max-h-[200px] lg:max-h-full h-full relative z-10;
@apply object-cover;
/* width: calc(100% - 2rem);
height: calc(100% - 2rem);
margin: 0 auto; */
}
.thumbnail-overlay {
@apply absolute z-0 rotate-3 top-6 left-6 w-full h-full border border-primary bg-white flex items-center justify-center;
transform: translate(2px, 2px) rotate(2deg);
/* transform: translate(12px, 12px) rotate(3deg); */
background-image: linear-gradient(#efe8ff, #efe8ff);
background-size: calc(100% - 12px) calc(100% - 12px);
background-repeat: no-repeat;
background-position: center;
background-blend-mode: color-burn;
&:after {
content: '';
@apply bg-carhop-purple-200;
width: calc(100% - 2rem);
height: calc(100% - 2rem);
}
}
}
.post-details {
@apply flex flex-col xl:flex-row xl:justify-between gap-x-4 gap-y-8 mt-12;
grid-template-columns: 1fr 1fr;
&__label {
@apply uppercase font-bold text-lg text-white;
letter-spacing: 0.2em;
}
}
.socials-buttons {
@apply flex flex-wrap justify-start xl:justify-end gap-4 h-fit shrink-0;
@screen xl {
min-width: 570px;
}
&__button {
@apply bg-white text-carhop-green-700 px-4 lg:px-6 md:px-8 !py-3 lg:!py-4 font-normal rounded-full w-max flex items-center gap-2;
transition: transform 0.3s ease-in-out;
&:hover {
transform: scale(1.05);
}
&[disabled] {
@apply opacity-50 cursor-not-allowed;
}
img {
@apply w-7 h-7 filter-primary;
}
&--like {
transition: all 0.3s ease-in-out;
.button-action-text {
max-width: 0;
overflow: hidden;
white-space: nowrap;
}
.likes-count {
max-width: 200px;
overflow: hidden;
/* transition: max-width 0.3s ease-in-out; */
white-space: nowrap;
}
&[data-likes-count='0'] {
.button-action-text {
max-width: 200px;
}
.likes-count {
max-width: 0;
}
}
&:hover {
.button-action-text {
max-width: 200px;
transition: max-width 0.3s ease-in-out;
}
.likes-count {
max-width: 0;
}
}
&.is-disabled {
@apply opacity-100 cursor-not-allowed hover:opacity-80;
.likes-count {
@apply block;
}
.button-action-text {
@apply max-w-0;
}
}
&.is-disabled:hover {
.button-action-text {
@apply max-w-[200px];
}
.likes-count {
@apply max-w-0;
}
}
}
&--share {
.socials-buttons__share-links {
@apply max-w-0 opacity-0 overflow-hidden max-h-7;
transition: all 0.3s ease-in-out;
}
&.is-open .socials-buttons__share-links {
@apply max-w-[200px] opacity-100;
}
.share-icon {
@apply max-w-[200px];
}
&.is-open {
.share-icon {
@apply max-w-0 overflow-hidden;
}
.socials-buttons__share-links {
overflow: visible;
}
.share-button {
transform: scale(1) !important;
transition: transform 0.2s ease-in-out !important;
}
.share-button:hover {
transform: scale(1.02) !important;
}
.copy-link,
.share-link {
@apply block w-7 h-7;
&:hover {
}
}
}
.share-link {
display: inline-block;
transition: transform 0.2s ease-in-out !important;
&:hover {
transform: scale(1.2) !important;
}
}
}
}
&__share-links {
@apply flex flex-wrap gap-2;
}
.share-link {
@apply transition-all duration-300;
&:after {
content: none;
}
img {
@apply w-7 h-7 filter-none;
}
&--copy-link {
@apply relative bg-transparent border-0 p-0 cursor-pointer;
.copy-feedback {
@apply absolute left-1/2 -translate-x-1/2 -bottom-8 bg-white text-primary px-3 py-1 rounded-md text-sm font-medium whitespace-nowrap z-50;
animation: fadeIn 0.3s ease-in-out;
}
}
}
}
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translate(-50%, -5px);
}
to {
opacity: 1;
transform: translate(-50%, 0);
}
}
.article-meta__related-revue {
flex-shrink: 1;
}
.article-meta__related-revue a {
@apply hover:underline underline-offset-8 text-white;
text-decoration-color: #fff;
text-decoration-thickness: 1px;
}
.article-meta__value {
@apply text-white font-light tracking-wide;
letter-spacing: 0.0015em;
}

View File

@ -1,19 +0,0 @@
.post-tag {
@apply w-fit bg-transparent px-3 py-2 relative text-primary border border-primary !list-none;
a {
text-decoration: none !important;
@apply block;
&:hover {
@apply !filter-none;
}
}
&:hover {
a {
@apply text-white;
}
@apply bg-primary text-white;
}
}
.post-tags-list {
@apply flex flex-wrap gap-2;
}

View File

@ -1,11 +0,0 @@
#post-toolbar {
@apply max-w-screen-2xl mx-auto;
}
.toolbar-actions {
@apply flex items-center gap-3 ml-auto;
@media screen and (max-width: 1024px) {
@apply absolute left-0 translate-y-full;
bottom: -20px;
}
}

View File

@ -48,8 +48,7 @@
} }
} }
} }
body.front-end {
form:not(:has(.gfield)) { form:not(:has(.gfield)) {
@apply form-carhop; @apply form-carhop;
} }
}

View File

@ -62,19 +62,6 @@ article > *:not(.entry-content),
@apply font-bold; @apply font-bold;
} }
} }
ul,
ol,
p {
@apply mb-6;
}
h1 {
@apply mb-10;
}
> h2,
> h3 {
@apply mb-3 mt-12;
font-size: 1.7rem;
}
} }
} }

View File

@ -70,18 +70,9 @@
@apply border-b border-white; @apply border-b border-white;
a { a {
@apply py-6 px-4 block w-full; @apply py-6 px-4 block w-full;
.page_subtitle {
@apply opacity-80 font-light mt-3 inline-block;
/* line-height: 1; */
}
.menu-item__content-inner {
transition: all 0.3s ease-out;
}
&:hover { &:hover {
backdrop-filter: brightness(0.8); backdrop-filter: brightness(0.9);
.menu-item__content-inner {
transform: translateX(4px);
}
} }
} }
&:last-child { &:last-child {
@ -96,7 +87,6 @@
} }
a.menu-item__content { a.menu-item__content {
transition: all 0.3s ease-out;
.menu-item__title { .menu-item__title {
@apply font-medium; @apply font-medium;
} }

View File

@ -1,88 +0,0 @@
.page--single-auteurs {
@apply max-w-screen-xl mx-auto px-4;
&__header {
@apply py-12 !my-0 bg-primary alignfull pb-80;
h1 {
@apply !text-5xl uppercase mb-8 col-span-2 !text-white;
}
p {
@apply text-white;
}
.inner {
@apply mx-auto flex flex-col lg:flex-row gap-24 justify-center items-center max-w-screen-xl;
}
.sub-infos {
@apply text-lg text-white flex gap-2 py-4;
.data-type {
@apply uppercase font-medium text-lg tracking-widest;
}
.articles-amount {
@apply 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;
}
}
}
.author-card__profile-picture {
@apply block col-span-2 lg:col-span-1 relative z-10 w-48 h-48 p-0;
.profile-picture-container {
@apply relative z-10 w-full h-full bg-white p-4;
z-index: 2;
}
.background-picture {
@apply absolute inset-0 w-full h-full bg-white;
z-index: -1;
transform: translate(30px, 30px) rotate(5deg);
&:after {
content: '';
@apply absolute inset-0 w-full h-full bg-carhop-green-100;
z-index: 2;
top: 1rem;
left: 1rem;
width: calc(100% - 2rem);
height: calc(100% - 2rem);
}
}
}
.infos {
@apply max-w-screen-md;
}
}
&__comities-list {
@apply flex flex-wrap gap-2 items-center col-span-2 text-primary font-normal pt-4;
}
&__comity {
@apply text-lg flex items-center gap-2 font-light tracking-wide;
&:before {
@apply content-[''] block w-6 h-6 bg-no-repeat bg-center;
background-size: contain;
}
+ .page--single-auteurs__comity {
@apply before:content-['|'] before:mx-2 before:text-primary;
}
&--redaction {
&:before {
background-image: url('../resources/img/icons/carhop-plume-white.svg');
}
}
}
&__latest-publication {
transform: translateY(-200px);
margin-bottom: -150px;
p {
@apply text-white uppercase text-lg font-semibold tracking-widest mb-8;
}
}
}

View File

@ -1,26 +0,0 @@
.page-single {
.post-toolbar {
@apply px-8;
}
.tags__title {
@apply text-lg uppercase font-semibold mt-0 my-4 nunito;
}
.tags-list {
@apply flex flex-wrap gap-4;
}
.content-wrapper {
&[data-active-tab='post'] {
#post-authors {
@apply hidden;
}
}
&[data-active-tab='authors'] {
.post-content {
@apply hidden;
}
}
}
}

View File

@ -77,9 +77,9 @@ $types = get_terms(array(
<ul class="post-grid__list"> <ul class="post-grid__list">
<?php if (isset($analyses_etudes_posts) && $analyses_etudes_posts->have_posts()) : ?> <?php if (isset($analyses_etudes_posts) && $analyses_etudes_posts->have_posts()) : ?>
<?php while ($analyses_etudes_posts->have_posts()) : $analyses_etudes_posts->the_post(); ?> <?php while ($analyses_etudes_posts->have_posts()) : $analyses_etudes_posts->the_post(); ?>
<?php get_template_part('template-parts/components/cards/post-card', null, array( <?php get_template_part('template-parts/analyses-etudes/card-analyse-etude', null, array(
'ID' => get_the_ID(), 'ID' => get_the_ID(),
'current_post_type' => 'analyses-etudes',
)); ?> )); ?>
<?php endwhile; ?> <?php endwhile; ?>
<?php endif; ?> <?php endif; ?>

View File

@ -1,51 +0,0 @@
<?php
$postId = $args['postId'] ?? get_the_ID();
$authors = get_field('authors', $postId);
$isArticle = is_singular('articles');
if ($isArticle) {
$authors = get_field('authors', $postId);
} else {
$authors = getRevueAuthors($postId);
}
if (empty($authors)) return;
// Construire une meta_query avec OR pour chaque auteur
$meta_query = array('relation' => 'OR');
foreach ($authors as $author) {
$meta_query[] = array(
'key' => 'authors',
'value' => '"' . $author->ID . '"', // Recherche la valeur sérialisée
'compare' => 'LIKE'
);
}
$authorsLastPosts = get_posts(array(
'post_type' => $isArticle ? 'articles' : 'revues',
'posts_per_page' => 6,
'orderby' => 'date',
'order' => 'DESC',
'meta_query' => $meta_query,
));
if (empty($authorsLastPosts) || count($authorsLastPosts) < 2) return;
?>
<div class="authors-last-publications">
<?php if (count($authors) <= 1) : ?>
<h3 class="title-small">Ses dernières publications</h3>
<?php else : ?>
<h3 class="title-small">Leurs dernières publications</h3>
<?php endif; ?>
<?php foreach ($authorsLastPosts as $post) : ?>
<?php get_template_part('template-parts/articles/card-article', null, array(
'ID' => $post->ID,
'showAuthors' => true,
)); ?>
<?php endforeach; ?>
</div>
<?php wp_reset_postdata(); ?>

View File

@ -1,21 +0,0 @@
<?php
$postId = $args['postId'];
$componentTitle = 'Auteur·e·s de l\'article';
$authors = get_field('authors', $postId);
?>
<section class="authors-list">
<h3 class="authors-list__title"><?php echo $componentTitle; ?></h3>
<?php foreach ($authors as $author) : ?>
<?php get_template_part(
'template-parts/components/cards/author-card',
null,
array(
'ID' => $author->ID,
)
); ?>
<?php endforeach; ?>
</section>

View File

@ -8,27 +8,28 @@ $member_email = get_field('email', $member_id);
$tumbnailPosition = get_field('profile_thumbnail_position', $member_id) ?? '50%'; $tumbnailPosition = get_field('profile_thumbnail_position', $member_id) ?? '50%';
?> ?>
<li class="comity-type__item member-card"> <li class="comity-type__item author-card">
<div class="member-card__profile-picture"> <div class="author-card__profile-picture">
<?php if ($member_thumbnail) : ?> <?php if ($member_thumbnail) : ?>
<a href="<?php echo get_the_permalink($member_id); ?>"> <a href="<?php echo get_the_permalink($author->ID); ?>">
<img style="object-position: 50% <?php echo $tumbnailPosition; ?>%;" src="<?php echo $member_thumbnail['url']; ?>" alt="<?php echo $member_thumbnail['alt']; ?>"> <img style="object-position: 50% <?php echo $tumbnailPosition; ?>%;" src="<?php echo $member_thumbnail['url']; ?>" alt="<?php echo $member_thumbnail['alt']; ?>">
</a> </a>
<?php else : ?> <?php else : ?>
<a href="<?php echo get_the_permalink($member_id); ?>"> <a href="<?php echo get_the_permalink($member_id); ?>">
<div class="member-card__profile-picture-placeholder member-card__profile-picture-placeholder--<?php echo $placeholder_thumbnail_counter % 3 + 1; ?>n"> <div class="author-card__profile-picture-placeholder author-card__profile-picture-placeholder--<?php echo $placeholder_thumbnail_counter % 3 + 1; ?>n">
<!-- <img class="" src="<?php echo get_template_directory_uri(); ?>/assets/images/placeholder-author.png" alt="Placeholder author"> -->
</div> </div>
</a> </a>
<?php endif; ?> <?php endif; ?>
</div> </div>
<h4 class="member-card__name"> <h4 class="author-card__name">
<a href="<?php echo get_the_permalink($member_id); ?>"> <?php echo $member_full_name ?></a> <a href="<?php echo get_the_permalink($member_id); ?>"> <?php echo $member_full_name ?></a>
</h4> </h4>
<div class="member-card__bio"><?php echo $member_description; ?></p> <div class="author-card__bio"><?php echo $member_description; ?></p>
<?php if ($member_email) : ?> <?php if ($member_email) : ?>
<a href="mailto:<?php echo $member_email; ?>" class="member-card__email cta cta--classic cta--rounded cta--has-icon cta--mailing"> <a href="mailto:<?php echo $member_email; ?>" class="author-card__email cta cta--classic cta--rounded cta--has-icon cta--mailing">
<div class="cta__icon"> <div class="cta__icon">
<?php $mail_svg_path = get_template_directory() . '/resources/img/icons/carhop-mail.svg'; <?php $mail_svg_path = get_template_directory() . '/resources/img/icons/carhop-mail.svg';
if (file_exists($mail_svg_path)) { if (file_exists($mail_svg_path)) {

View File

@ -0,0 +1,26 @@
<?php
$communique_id = $args['communique_id'];
$communique_file = get_field('file', $communique_id);
$communique_file_url = $communique_file['url'];
$communique_file_size = size_format($communique_file['filesize']);
$communique_file_type = $communique_file['subtype'];
?>
<div class="communique-card">
<?php get_template_part('template-parts/components/content-meta', null, array(
'current_post_type' => 'communique-presse',
'current_post_id' => $communique_id
)); ?>
<h3><?php echo get_the_title($communique_id); ?></h3>
<div class="communique-card__file-infos">
<time datetime="<?php echo get_the_date('Y-m-d', $communique_id); ?>"><?php echo get_the_date('d F Y', $communique_id); ?></time>
<?php if ($communique_file) : ?>
<span>|</span>
<span class="communique-card__file-type"><?php echo $communique_file_type; ?></span>
<span class="communique-card__file-size">(<?php echo $communique_file_size; ?>)</span>
<?php endif; ?>
</div>
<!-- <a href="<?php echo get_permalink($communique_id); ?>" class="button">Voir le communiqué</a> -->
</div>

View File

@ -82,7 +82,7 @@ $types = get_terms(array(
<ul class="post-grid__list"> <ul class="post-grid__list">
<?php if (isset($posts_query) && $posts_query->have_posts()) : ?> <?php if (isset($posts_query) && $posts_query->have_posts()) : ?>
<?php while ($posts_query->have_posts()) : $posts_query->the_post(); ?> <?php while ($posts_query->have_posts()) : $posts_query->the_post(); ?>
<?php get_template_part('template-parts/components/cards/post-card', null, array( <?php get_template_part('template-parts/components/post-card', null, array(
'ID' => get_the_ID(), 'ID' => get_the_ID(),
)); ?> )); ?>
<?php endwhile; ?> <?php endwhile; ?>

View File

@ -1,43 +0,0 @@
<?php
$ID = $args['ID'];
$name = get_the_title($ID);
$link = get_the_permalink($ID);
$profilePicture = get_field('profile_thumbnail', $ID);
$profilePictureUrl = $profilePicture['url'] ?? '';
$profilePictureAlt = $profilePicture['alt'] ?? '';
$description = get_field('description', $ID);
$is_carhop_member = get_field('is_carhop_member', $ID);
$carhop_member_id = get_field('carhop_member', $ID);
if ($is_carhop_member && isset($carhop_member_id)) {
switch_to_blog(1);
$description = get_field('description', $carhop_member_id);
$profilePicture = get_field('profile_thumbnail', $carhop_member_id);
$profilePictureUrl = $profilePicture['url'] ?? '';
$profilePictureAlt = $profilePicture['alt'] ?? '';
restore_current_blog();
}
?>
<a href="<?php echo $link; ?>" class="author-card">
<div class="author-card__profile-picture">
<?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="author-card__infos">
<h3 class="author-card__name"><?php echo $name; ?></h3>
</div>
<div class="author-card__description">
<?php echo $description; ?>
</div>
</a>

View File

@ -1,33 +0,0 @@
<?php
$communique_id = $args['communique_id'];
$communique_file = get_field('file', $communique_id);
$communique_file_url = $communique_file['url'];
$communique_file_size = size_format($communique_file['filesize']);
$communique_file_type = $communique_file['subtype'];
?>
<div class="communique-card">
<?php get_template_part('template-parts/components/content-meta', null, array(
'current_post_type' => 'communique-presse',
'current_post_id' => $communique_id
)); ?>
<div class="communique-card__inner">
<div class="communique-card__content">
<h3><?php echo get_the_title($communique_id); ?></h3>
<div class="communique-card__file-infos">
<time datetime="<?php echo get_the_date('Y-m-d', $communique_id); ?>"><?php echo get_the_date('d F Y', $communique_id); ?></time>
<?php if ($communique_file) : ?>
<span>|</span>
<span class="communique-card__file-type"><?php echo $communique_file_type; ?></span>
<span class="communique-card__file-size">(<?php echo $communique_file_size; ?>)</span>
<?php endif; ?>
</div>
</div>
<?php get_template_part('template-parts/components/cta--download', null, array(
'url' => $communique_file_url,
'alt' => 'Télécharger le communiqué',
'target' => '_blank',
)); ?>
</div>
</div>

View File

@ -6,15 +6,13 @@ $current_post_type_supports_type = is_object_in_taxonomy($current_post_type, 'ty
$hasNumerotation = hasPostTypeNumerotation($current_post_type); $hasNumerotation = hasPostTypeNumerotation($current_post_type);
if ($current_post_type_supports_type) { if ($current_post_type_supports_type) {
$type_term = get_the_terms($current_post_id, 'type')[0] ?? null; $type = get_the_terms($current_post_id, 'type') ?? null;
if ($type_term) {
$type = $type_term->name;
}
// $current_post_type === 'analyses-etudes' && is_array($type) && !empty($type) && isset($type[0]->name // $current_post_type === 'analyses-etudes' && is_array($type) && !empty($type) && isset($type[0]->name
} else { } else {
$current_post_type_obj = get_post_type_object($current_post_type); $current_post_type_obj = get_post_type_object($current_post_type);
$type = $current_post_type_obj->labels->singular_name; $type = $current_post_type_obj->labels->singular_name;
} }
?> ?>
@ -24,11 +22,9 @@ if ($current_post_type_supports_type) {
<?php endif; ?> <?php endif; ?>
<?php if ($hasNumerotation) : ?> <?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"> <p class="content-meta__revue-issue content-meta__revue-issue--green">
<span class="revue-issue-number revue-meta__label sr-only">Numéro</span> <span class="revue-issue-number revue-meta__label sr-only">Numéro</span>
<?php echo $numerotation; ?> 28
</p> </p>
<?php endif; ?> <?php endif; ?>
</div> </div>

View File

@ -1,9 +0,0 @@
<?php
$url = $args['url'] ?? '#';
$alt = $args['alt'] ?? 'Lire la suite';
$target = $args['target'] ?? '_self';
$directDownload = $args['directDownload'] ?? false;
?>
<a href="<?php echo esc_url($url); ?>" class="cta cta--download cta--primary" target="<?php echo esc_attr($target); ?>"<?php echo $directDownload ? ' download' : ''; ?>>
<img src="<?php echo get_template_directory_uri(); ?>/resources/img/carhop-fleche-full-90.svg" alt="<?php echo $alt; ?>">
</a>

View File

@ -4,24 +4,19 @@ $current_post_type = $args['current_post_type'] ?? get_post_type();
$types_terms = get_the_terms($ID, 'type'); $types_terms = get_the_terms($ID, 'type');
$type = isset($types_terms[0]) ? $types_terms[0] : null; $type = isset($types_terms[0]) ? $types_terms[0] : null;
$title = get_the_title($ID); $title = get_the_title($ID);
$showExcerpt = $args['show_excerpt'] ?? false;
$excerpt = get_the_excerpt($ID); $excerpt = get_the_excerpt($ID);
$link = get_the_permalink($ID); $link = get_the_permalink($ID);
$image = get_the_post_thumbnail_url($ID); $image = get_the_post_thumbnail_url($ID);
$date = get_the_date('F Y', $ID); $date = get_the_date('F Y', $ID);
$authors = get_field('authors', $ID); $authors = get_field('authors', $ID);
$editors = get_field('editors', $ID);
$numerotation = get_post_meta($ID, 'post_numerotation', true); $numerotation = get_post_meta($ID, 'post_numerotation', true);
$tags = get_the_terms($ID, 'etiquettes');
?> ?>
<a class="post-card post-card--<?php echo $current_post_type; ?> card" href="<?php echo $link; ?>"> <div class="post-card post-card--<?php echo $current_post_type; ?> card">
<?php get_template_part('template-parts/components/content-meta', null, array( <?php get_template_part('template-parts/components/content-meta', null, array(
'current_post_type' => $current_post_type, 'current_post_type' => $current_post_type,
'current_post_id' => $ID 'current_post_id' => $ID
@ -29,13 +24,11 @@ $tags = get_the_terms($ID, 'etiquettes');
<div class="card__inner"> <div class="card__inner">
<div class="card__content"> <div class="card__content">
<h3 class="card__title"><?php echo $title; ?></h3> <h3 class="card__title"><?php echo $title; ?></h3>
<?php if ($showExcerpt) : ?>
<div class="card__excerpt"><?php echo $excerpt; ?></div> <div class="card__excerpt"><?php echo $excerpt; ?></div>
<?php endif; ?>
</div> </div>
<div class="card__details"> <div class="card__details">
<div class="post-card__details-text"> <div class="card__details-text">
<time datetime="<?php echo $date; ?>" class="card__details-date date"><?php echo $date; ?></time> <time datetime="<?php echo $date; ?>" class="card__details-date date"><?php echo $date; ?></time>
<?php if ($authors) : ?> <?php if ($authors) : ?>
@ -43,9 +36,6 @@ $tags = get_the_terms($ID, 'etiquettes');
<?php foreach ($authors as $author) : ?> <?php foreach ($authors as $author) : ?>
<li class="author"><?php echo $author->post_title; ?></li> <li class="author"><?php echo $author->post_title; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
<?php foreach ($editors as $editor) : ?>
<li class="editor"><?php echo $editor->post_title; ?></li>
<?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</div> </div>
@ -54,16 +44,9 @@ $tags = get_the_terms($ID, 'etiquettes');
<?php the_post_thumbnail('medium'); ?> <?php the_post_thumbnail('medium'); ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php if ($tags) : ?>
<ul class="tag-list">
<?php foreach ($tags as $tag) : ?>
<li class="tag-list__tag"><?php echo $tag->name; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div> </div>
</div> </div>
</a> </div>

View File

@ -1,8 +0,0 @@
<?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 -->';
echo do_blocks($block_content);