Images des annonces : seul le titre peut servir de légende
Les légendes des médias ne sont plus jamais affichées sous les images des annonces et des séances. Le titre de l'image s'affiche uniquement quand « Afficher le titre des images en légende » est cochée ; sinon, aucune légende. WordPress remplit automatiquement la légende à l'upload à partir des métadonnées EXIF/IPTC du fichier (ex. « Screenshot » pour les captures macOS), ce qui faisait apparaître un texte malgré la case décochée.
This commit is contained in:
@@ -189,7 +189,6 @@ function thalim_get_single_data($post_id) {
|
|||||||
$data['images'][] = [
|
$data['images'][] = [
|
||||||
'url' => $src,
|
'url' => $src,
|
||||||
'alt' => get_post_meta($doc_id, '_wp_attachment_image_alt', true) ?: '',
|
'alt' => get_post_meta($doc_id, '_wp_attachment_image_alt', true) ?: '',
|
||||||
'caption' => thalim_bilingual(wp_get_attachment_caption($doc_id) ?: '', $lang),
|
|
||||||
'title' => thalim_bilingual(get_the_title($doc_id) ?: '', $lang),
|
'title' => thalim_bilingual(get_the_title($doc_id) ?: '', $lang),
|
||||||
'portrait' => thalim_image_is_portrait($doc_id, $w, $h),
|
'portrait' => thalim_image_is_portrait($doc_id, $w, $h),
|
||||||
];
|
];
|
||||||
@@ -351,7 +350,6 @@ function thalim_get_single_data($post_id) {
|
|||||||
$seance_data['images'][] = [
|
$seance_data['images'][] = [
|
||||||
'url' => $src,
|
'url' => $src,
|
||||||
'alt' => get_post_meta($doc_id, '_wp_attachment_image_alt', true) ?: '',
|
'alt' => get_post_meta($doc_id, '_wp_attachment_image_alt', true) ?: '',
|
||||||
'caption' => thalim_bilingual(wp_get_attachment_caption($doc_id) ?: '', $lang),
|
|
||||||
'title' => thalim_bilingual(get_the_title($doc_id) ?: '', $lang),
|
'title' => thalim_bilingual(get_the_title($doc_id) ?: '', $lang),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
<div class="swiper-slide">
|
<div class="swiper-slide">
|
||||||
<figure>
|
<figure>
|
||||||
<img src="{{ img.url }}" alt="{{ img.alt }}" loading="lazy">
|
<img src="{{ img.url }}" alt="{{ img.alt }}" loading="lazy">
|
||||||
{% set legend = article.show_image_titles and img.title ? img.title : img.caption %}
|
{% set legend = article.show_image_titles ? img.title : '' %}
|
||||||
{% if legend %}
|
{% if legend %}
|
||||||
<figcaption>{{ legend }}</figcaption>
|
<figcaption>{{ legend }}</figcaption>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
{% for img in landscape_images %}
|
{% for img in landscape_images %}
|
||||||
<figure>
|
<figure>
|
||||||
<img src="{{ img.url }}" alt="{{ img.alt }}" loading="lazy">
|
<img src="{{ img.url }}" alt="{{ img.alt }}" loading="lazy">
|
||||||
{% set legend = article.show_image_titles and img.title ? img.title : img.caption %}
|
{% set legend = article.show_image_titles ? img.title : '' %}
|
||||||
{% if legend %}
|
{% if legend %}
|
||||||
<figcaption>{{ legend }}</figcaption>
|
<figcaption>{{ legend }}</figcaption>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
<div class="swiper-slide">
|
<div class="swiper-slide">
|
||||||
<figure class="sidebar-portrait">
|
<figure class="sidebar-portrait">
|
||||||
<img src="{{ img.url }}" alt="{{ img.alt }}" loading="lazy">
|
<img src="{{ img.url }}" alt="{{ img.alt }}" loading="lazy">
|
||||||
{% set legend = article.show_image_titles and img.title ? img.title : img.caption %}
|
{% set legend = article.show_image_titles ? img.title : '' %}
|
||||||
{% if legend %}
|
{% if legend %}
|
||||||
<figcaption>{{ legend }}</figcaption>
|
<figcaption>{{ legend }}</figcaption>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<figure class="sidebar-portrait">
|
<figure class="sidebar-portrait">
|
||||||
<img src="{{ portrait_images[0].url }}" alt="{{ portrait_images[0].alt }}" loading="lazy">
|
<img src="{{ portrait_images[0].url }}" alt="{{ portrait_images[0].alt }}" loading="lazy">
|
||||||
{% set legend = article.show_image_titles and portrait_images[0].title ? portrait_images[0].title : portrait_images[0].caption %}
|
{% set legend = article.show_image_titles ? portrait_images[0].title : '' %}
|
||||||
{% if legend %}
|
{% if legend %}
|
||||||
<figcaption>{{ legend }}</figcaption>
|
<figcaption>{{ legend }}</figcaption>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -353,7 +353,7 @@
|
|||||||
{% for img in s.images %}
|
{% for img in s.images %}
|
||||||
<figure>
|
<figure>
|
||||||
<img src="{{ img.url }}" alt="{{ img.alt }}" loading="lazy">
|
<img src="{{ img.url }}" alt="{{ img.alt }}" loading="lazy">
|
||||||
{% set legend = s.show_image_titles and img.title ? img.title : img.caption %}
|
{% set legend = s.show_image_titles ? img.title : '' %}
|
||||||
{% if legend %}
|
{% if legend %}
|
||||||
<figcaption>{{ legend }}</figcaption>
|
<figcaption>{{ legend }}</figcaption>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -444,7 +444,7 @@
|
|||||||
{% for img in s.images %}
|
{% for img in s.images %}
|
||||||
<figure>
|
<figure>
|
||||||
<img src="{{ img.url }}" alt="{{ img.alt }}" loading="lazy">
|
<img src="{{ img.url }}" alt="{{ img.alt }}" loading="lazy">
|
||||||
{% set legend = s.show_image_titles and img.title ? img.title : img.caption %}
|
{% set legend = s.show_image_titles ? img.title : '' %}
|
||||||
{% if legend %}
|
{% if legend %}
|
||||||
<figcaption>{{ legend }}</figcaption>
|
<figcaption>{{ legend }}</figcaption>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user