Images centrées dans la boucle de requête au lieu d’être alignées à gauche
-
Bonjour,
Je rencontre un comportement étrange avec mon site amavero.fr, hébergé sur WordPress.com Business, thème Twenty Twenty-Five.
Dans une page de boucle de requête (query loop), toutes mes images d’articles ont toujours été alignées à gauche. Mais depuis quelques jours, tous les nouveaux articles (catégorie art contemporain) affichent leur image centrée dans la boucle, alors que :
- Dans l’article individuel (single post), l’image est bien alignée à gauche (voir capture image-correcte.png).
- Pour les anciens articles, dans la même boucle de requête, l’image reste alignée à gauche comme avant (voir capture image-correcte.png).
- Aucun paramètre de la boucle n’a été changé volontairement.
J’ai vérifié :
- Les images utilisent bien la classe
alignleftdans l’article. - Le code HTML généré pour les nouveaux articles semble identique à celui des anciens.
- Mon CSS personnalisé force déjà le
text-align: left, mais cela ne change rien. - Le problème apparaît uniquement pour les nouveaux articles.
Captures d’écran :
- image-decalee.png → exemple d’un article récent (image centrée)
- image-correcte.png → exemple d’un ancien article (image alignée à gauche)
Je soupçonne soit :
- un changement récent dans le rendu des boucles de requêtes du thème,
- soit un bug introduit dans le moteur de blocs Gutenberg.
Merci d’avance pour votre aide ! 🙏
— Luc Fayard (lfonelfa)English version :Hello,
I’m facing a strange issue on my website amavero.fr, hosted on WordPress.com Business, using the Twenty Twenty-Five theme.
In a query loop page, all my post images used to be aligned left. But for the past few days, all newly published posts (category art contemporain) display their images centered in the loop, while:
- In the single post view, the image is correctly aligned left (see image-correcte.png).
- Older posts in the same query loop are still aligned left (see image-correcte.png).
- I haven’t intentionally changed any query loop parameters.
Checks performed:
- Images still have the
alignleftclass inside the post. - HTML output for new vs old posts seems identical.
- I’ve already tried forcing
text-align: leftvia custom CSS — no effect. - Issue affects only newly published posts.
Screenshots:
- image-decalee.png → example of a recent post (image centered)
- image-correcte.png → example of an older post (image left-aligned)
I suspect either:
- a recent change in the query loop rendering of the theme, or
- a bug introduced in Gutenberg.
Thanks a lot for your help!
— Luc Fayard (lfonelfa)

The blog I need help with is: (visible only to logged in users)
-
Hi there!
I took a look at your site, and it appears that neither of these two images is centered https://d.pr/v/CxoXhq. It looks like that because in https://amavero.fr/ilse-dhollander-untitled-1996/ the image is bigger, and it is harder to notice.
But no worries, you can center them like this https://d.pr/v/FHi18T
Also, it will work if you add just the Image block; the Group and Columns blocks are not needed to center the image.
I hope it helps!
- The topic ‘Images centrées dans la boucle de requête au lieu d’être alignées à gauche’ is closed to new replies.