Compare commits

..

No commits in common. "7338d58e6e4823dee0222783f29ad71158eca2c0" and "a26a889f35485565ea285416890a1b6cb8e18aa7" have entirely different histories.

9 changed files with 6 additions and 73 deletions

View File

@ -517,38 +517,3 @@ function get_search_snippet($post_id, $search_term, $context_length = 150)
return $snippet;
}
/**
* Helper sécurisé pour récupérer le focal point (avec fallback si plugin désactivé)
*
* @param int|null $post_id ID du post (null pour le post courant)
* @return array Tableau avec 'x' et 'y' (valeurs entre 0 et 1)
*/
function safe_get_thumbnail_focal_point($post_id = null)
{
// Vérifier si la fonction du plugin existe
if (function_exists('get_thumbnail_focal_point')) {
return get_thumbnail_focal_point($post_id);
}
// Fallback : centre de l'image par défaut
return ['x' => 0.5, 'y' => 0.5];
}
/**
* Helper sécurisé pour récupérer le focal point au format CSS (avec fallback si plugin désactivé)
*
* @param int|null $post_id ID du post (null pour le post courant)
* @return string Format "50% 50%" pour object-position ou background-position
*/
function safe_get_thumbnail_focal_point_css($post_id = null)
{
// Vérifier si la fonction du plugin existe
if (function_exists('get_thumbnail_focal_point_css')) {
return get_thumbnail_focal_point_css($post_id);
}
// Fallback : centre de l'image par défaut
return '50% 50%';
}

View File

@ -5,16 +5,6 @@
@apply lg:flex gap-16 xl:gap-32;
}
&__subtitle {
br {
display: none;
}
@screen lg {
br {
display: block;
}
}
}
.tag-list {
@apply flex gap-6 flex-wrap;

View File

@ -33,9 +33,7 @@ $articles = get_field('articles', $current_issue->ID);
<ul class="tags-list">
<?php foreach ($tags as $tag) : ?>
<li>
<a class="article-tag" href="<?php echo add_query_arg('etiquette', $tag->slug, get_post_type_archive_link('articles')); ?>">
<?php echo $tag->name; ?>
</a>
<a class="article-tag" href="<?php echo get_term_link($tag); ?>"><?php echo $tag->name; ?></a>
</li>
<?php endforeach; ?>
</ul>

View File

@ -12,9 +12,7 @@ $tags = get_the_terms($articleID, 'etiquettes');
<ul class="article-tags-list">
<?php foreach ($tags as $tag) : ?>
<li class="article-tag">
<a href="<?php echo add_query_arg('etiquette', $tag->slug, get_post_type_archive_link('articles')); ?>">
<?php echo $tag->name; ?>
</a>
</li>
<?php endforeach; ?>
</ul>

View File

@ -82,7 +82,6 @@ $thematiques = get_terms(array(
<?php while ($articles->have_posts()) : $articles->the_post(); ?>
<?php get_template_part('template-parts/articles/card-article', null, array(
'date' => get_the_date(),
'ThumbnailFocalPosition' => get_thumbnail_focal_point_css(),
'image' => get_the_post_thumbnail_url(),
'link' => get_the_permalink(),
'ID' => get_the_ID(),

View File

@ -17,12 +17,7 @@ $authors = get_field('authors', $ID);
<?php if ($cover) : ?>
<div class="post-card__cover">
<?php
$focal_position = $args['ThumbnailFocalPosition'] ?? null;
echo get_the_post_thumbnail($ID, 'full', [
'style' => 'object-fit: cover; object-position: ' . esc_attr($focal_position) . ';'
]);
?>
<img src="<?php echo $cover; ?>" alt="<?php echo $title; ?>">
</div>
<?php endif; ?>
<div class="post-card__content">

View File

@ -26,13 +26,7 @@ $likes_count = get_post_likes_count($post_id);
<?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) . ';'
]);
?>
<?php the_post_thumbnail('full', ['class' => 'thumbnail']); ?>
<div class="thumbnail-overlay"></div>
</div>
<?php endif; ?>

View File

@ -12,12 +12,7 @@ $is_multiple_issue_number = $issue_number && is_numeric($issue_number) && strpos
<?php if ($cover) : ?>
<div class="post-card__cover">
<?php
$focal_position = $args['ThumbnailFocalPosition'] ?? null;
echo get_the_post_thumbnail($ID, 'full', [
'style' => 'object-fit: cover; object-position: ' . esc_attr($focal_position) . ';'
]);
?>
<img src="<?php echo $cover; ?>" alt="<?php echo $title; ?>">
</div>
<?php endif; ?>
<div class="post-card__content">

View File

@ -65,8 +65,7 @@ $thematiques = get_terms(array(
'date' => get_the_date(),
'image' => get_the_post_thumbnail_url(),
'link' => get_the_permalink(),
'ID' => get_the_ID(),
'ThumbnailFocalPosition' => get_thumbnail_focal_point_css(),
'ID' => get_the_ID()
)); ?>
<?php endwhile; ?>
<?php endif; ?>