From 5bbaeea7b37474f9d0476d7b85a1ab3b47079b2e Mon Sep 17 00:00:00 2001 From: Nonimart Date: Thu, 16 Oct 2025 11:41:27 +0200 Subject: [PATCH] FEATURE Introducing the ThumbnailFocalPosition plugin features --- template-parts/articles/articles-grid.php | 1 + template-parts/articles/card-article.php | 7 ++++++- template-parts/post-header.php | 8 +++++++- template-parts/revues/card-revue.php | 7 ++++++- template-parts/revues/revues-grid.php | 3 ++- 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/template-parts/articles/articles-grid.php b/template-parts/articles/articles-grid.php index 4bc4a47..d39bbe1 100644 --- a/template-parts/articles/articles-grid.php +++ b/template-parts/articles/articles-grid.php @@ -82,6 +82,7 @@ $thematiques = get_terms(array( have_posts()) : $articles->the_post(); ?> get_the_date(), + 'ThumbnailFocalPosition' => get_thumbnail_focal_point_css(), 'image' => get_the_post_thumbnail_url(), 'link' => get_the_permalink(), 'ID' => get_the_ID(), diff --git a/template-parts/articles/card-article.php b/template-parts/articles/card-article.php index 2356335..baa3c8c 100644 --- a/template-parts/articles/card-article.php +++ b/template-parts/articles/card-article.php @@ -17,7 +17,12 @@ $authors = get_field('authors', $ID);
- <?php echo $title; ?> + 'object-fit: cover; object-position: ' . esc_attr($focal_position) . ';' + ]); + ?>
diff --git a/template-parts/post-header.php b/template-parts/post-header.php index dbce6c3..0b1febc 100644 --- a/template-parts/post-header.php +++ b/template-parts/post-header.php @@ -26,7 +26,13 @@ $likes_count = get_post_likes_count($post_id);
- 'thumbnail']); ?> + 'thumbnail', + 'style' => 'object-fit: cover; object-position: ' . esc_attr($focal_position) . ';' + ]); + ?>
diff --git a/template-parts/revues/card-revue.php b/template-parts/revues/card-revue.php index aa3f972..d8a2105 100644 --- a/template-parts/revues/card-revue.php +++ b/template-parts/revues/card-revue.php @@ -12,7 +12,12 @@ $is_multiple_issue_number = $issue_number && is_numeric($issue_number) && strpos
- <?php echo $title; ?> + 'object-fit: cover; object-position: ' . esc_attr($focal_position) . ';' + ]); + ?>
diff --git a/template-parts/revues/revues-grid.php b/template-parts/revues/revues-grid.php index a8ddc42..b398ae6 100644 --- a/template-parts/revues/revues-grid.php +++ b/template-parts/revues/revues-grid.php @@ -65,7 +65,8 @@ $thematiques = get_terms(array( 'date' => get_the_date(), 'image' => get_the_post_thumbnail_url(), 'link' => get_the_permalink(), - 'ID' => get_the_ID() + 'ID' => get_the_ID(), + 'ThumbnailFocalPosition' => get_thumbnail_focal_point_css(), )); ?>