Questions tagged [captions]
In WordPress images are special types of posts. The caption of an image is stored as the excerpt of that post.
116 questions
0 votes
1 answer
112 views
Woocommerce Gallery Image Caption: Use "caption" — not "alt tag". Keep <img> alt tag as is
The website wasn't showing text ("captions") for the product images (the primary image and the gallery images). That was resolved by copying the woocommerce ../product-image.php file to the ...
0 votes
1 answer
97 views
CSS how to target the caption of one individual image?
I can use .wp-element-caption to change all site captions at once, but I want to target one specific caption at a time. Because I'm adding additional CSS to a premade WP theme, I can't find a way to ...
0 votes
0 answers
38 views
How Do I Prevent Featured Image Caption Displaying Above And Below Image
I'm trying to add an image caption below my featured image on my single posts. I have this working, but weirdly they are also displaying above the image. I'm hoping someone can help point out the ...
1 vote
1 answer
178 views
Add custom text before all image captions in WordPress posts
I add captions to images in WordPress using the "Caption" box to indicate the photographer's name. I need custom text to always be displayed before the image caption, That is, now I just ...
0 votes
1 answer
92 views
Customize all image captions
Is there anyway to add smth like a SVG to all image captions of my website? Smth like the camera logo under this photo.
0 votes
0 answers
161 views
Permission to edit media files (photo captions, alt tags)
What permission is required for a user to be able to edit all media files in Wordpress? I'm trying to edit the captions and alt tags of some media files in Wordpress. I can see the media file in the &...
1 vote
1 answer
2k views
PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in Stack trace:\n#0 [internal function]: img_caption_shortcode()
Why am I getting this error in my apache logs? ==> tech.michaelaltfield.net/error.log <== [Wed Aug 23 00:00:09.968658 2023] [php:error] [pid 459909] [client 0.0.0.0:0] PHP Fatal error: Uncaught ...
0 votes
1 answer
161 views
Adding caption to all images inside an article
My client has decided he wants to add inside the article body, for each image, the caption below the img tag. I know WordPress has this shortcode built in, but since there are more than 300 articles, ...
0 votes
1 answer
504 views
Place image caption outside of figure tag (Gutenburg Image Markup)
I format my single.php images to a perceived 3:2 ratio like this: <figure style="position:relative; width:100%; padding-bottom:66%;"> <img style="position:absolute; width:100%; ...
0 votes
0 answers
208 views
Not able to remove caption shortcode from the content
[caption id="attachment_6" align="alignright" width="300"]...Some Text...[/caption] I am unable to remove caption shortcode from the content of the post. I have tried ...
0 votes
0 answers
614 views
How to modify image caption in posts?
I am trying to modify the caption of images in posts by filtering img_caption_shortcode, and then displaying the content using the_content(). I want to add bylines/credit on images, so I have created ...
0 votes
1 answer
321 views
how automatically show the image title before the image caption/description in a wordpress gallery?
I am using a simple Wp 5.x gallery like this [gallery size="full" columns="1" ids="6304,6305,6306,6307,6308,6309"] The gallery shows me the images and the captions/...
0 votes
1 answer
518 views
How to Display Image Caption but Not Alt Text
I'm trying to display images with their caption, but when I do it displays both the caption and that alt text. I've tried to use unset( $fields['image_alt'] ); to hide the alt text, but it does ...
1 vote
1 answer
381 views
Add post-thumbnail after first paragraph including the caption
The function below is used to show the post thumbnail after the first paragraph. add_filter( 'the_content', 'insert_featured_image', 20 ); function insert_featured_image( $content ) { global $post;...
0 votes
1 answer
609 views
Omit image captions from get_the_content()
I use a theme that calls get_the_content() to display short excerpts of the latest blog posts on the home page. Now I noticed that the excerpt sometimes starts with an image caption, if the blog post ...