Questions tagged [captions]

In WordPress images are special types of posts. The caption of an image is stored as the excerpt of that post.

30 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
1answer
241 views

Drag images with caption in WP editor

Whenever I insert an image without a caption in the post, the editor makes it an object that I can select and move around / scale. Whenever I insert an image with a caption, it inserts fine. I can ...
1
vote
0answers
24 views

Move Image Captions Inside Link (<a> tag) if Added

I'm just looking for a relatively simple way to modify the default output when a standard post image with a caption is linked somewhere (generally to another page), so that the caption is included in ...
1
vote
1answer
45 views

Can I nest a <figcaption> element within <a> tags from default wordpress?

I am making a page with Gutenberg but there is a problem that the link does not work within a . This is the code when I inspect: <figure> <a href="..."> <img> </a> <...
1
vote
0answers
22 views

How to add custom classes to figure element only if image has caption?

I want to add the 'wp-caption' class to the figure element only if the image has caption. How do I do that? I'm using the new gutenberg enviroment, if that affects anything. for example: form this: ...
1
vote
0answers
211 views

modify wordpress caption shortcode

I need to modify the Caption shortcode so that it renders the caption wrapper regardless if there is any caption text present. I've modified my Media content type with a custom field called Credit. ...
1
vote
1answer
130 views

Replace image caption with its title and description

Is it possible to replace the caption text of an image with its title and description fields when inserting it in the editor? If so, how? Thanks in advance
1
vote
1answer
596 views

Forcing max-width for image captions

I've implemented a filter to my image captions based on this question I asked a few days ago. How can I slip into the caption the css style of max-width as well? I think it can be done with ...
1
vote
1answer
218 views

Way to add captions to gallery images by code

I am creating posts by using wp_insert_post function. It works fine as I provide values in array required. Sometimes it is required to create a post having gallery. Without any problem, it also works ...
0
votes
0answers
11 views

Force user to input image caption when uploading an image

How can I force the user to input an image caption when uploading a picture via the Add Media button in the document edit view? See picture. It should not be possible to upload an image without a ...
0
votes
0answers
18 views

How to auto add image caption from image alt?

How to automatically copy image alt to caption/description in WordPress?
0
votes
0answers
16 views

Disabling/Remove Caption Field for uploads in admin

Can someone please assist me. I've been trying to disable/hide the caption field for uploads in admin. Using the functions file in the child theme so that it doesn't get overwritten when WordPress ...
0
votes
2answers
25 views

Is there a way to create referable automatic numbering in image captions?

I'm setting up a wordpress site for someone who is going to be continually editing and expanding the pages. Right now we have sometimes up to 50 images per page all manually labeled "figure x.x". He ...
0
votes
0answers
64 views

Adjust image caption within visal editor

once again I would like to ask you for your kind help. Basically I want to adjust the image caption below single post images. Instead of displaying the caption (post_excerpt), I would like to ...
0
votes
1answer
383 views

How to hide / remove attachment “alt” or “caption” field in Admin?

Until WP 3.6 it was possible to remove the "alt" field (and also the "caption" field) before showing a post of type "attachment" through attachment_fields_to_edit hook. As you can see also here (user ...
0
votes
1answer
80 views

Displaying “alt” attribute text as captions?

We are moving a large newspaper website from Drupal to WordPress and my last coding tweak involves displaying the legacy caption information from images in article posts. The caption information is ...
0
votes
1answer
216 views

Add caption to thumbnails in content

Still trying to get the answer, i don't really know wordpress core (but i'm actually pretty good in PHP), I can't find how to add caption to my images in posts. I know we can use get_posts to any ...
0
votes
1answer
469 views

Gallery IDS and Captions: hide/show on a per ID basis

I am aware of hiding captions in a gallery via css on figcaption, like .wp-caption-text/.gallery-caption for example. What I am looking for is a way to have custom control of hiding captions on ...
0
votes
1answer
102 views

slider stripping out caption/excerpt line breaks

I ran into an issue where the slider I was using (Wonderplugin) was stripping out paragraph and other formatting tags on captions/descriptions, though they were working on the actual images in Posts.
0
votes
1answer
353 views

Update caption for metabox gallery images

Just wondering how to make the caption on my metabox gallery images updatable. I have the caption on a textarea so it can be easily updated. I can change the contents of this textarea, cant seem to be ...
0
votes
1answer
365 views

How to always add caption element to images - even if empty?

I want to add the caption ALWAYS to images, even if it is empty. This is my function to add the caption, but the caption element will not be generated when there is no content in it, how to add the ...
0
votes
1answer
222 views

Automatically Add Caption Shortcode to Image with Caption Field Filled In

I am hoping to be able to have the [caption] shortcode automatically get inserted into the post content area when you add in an image that has the caption field filled in. I believe this is supposed ...
0
votes
1answer
585 views

Wordpress Caption Formatting

I'm trying to create a custom wordpress theme. Everything has gone fine, except image formatting in post content. Image captions are not displaying properly in newly created theme. I have already ...
0
votes
1answer
259 views

Move captions under gallery images in twenty fourteen theme

The new twenty fourteen theme will only show captions on top of gallery thumbs. Is there something I can do in the functions (or copy from twenty ten) to make them visible all the time and show up ...
0
votes
1answer
883 views

Remove Captions from Custom Gallery function.php

I like to prevent captions from being outputted in my custom gallery function. I could easily just hide it using CSS but it doesn't feel right. The caption is being sent from media.php this line. ...
0
votes
0answers
900 views

page displaying media caption shortcodes

I am developing my first wordpress theme. I encountered a problem in page section. I added a image in a page with add media button. When i viewed the page, it does display the image but also the ...
0
votes
0answers
374 views

SQL query to remove first image in all posts

I've built a site up over a few years (3,500+ posts) where I've inserted images using the traditional method into the post content itself. I'm now moving to a different theme, and have made the first ...
0
votes
1answer
75 views

How to change images size after theme modification?

The images in the previous theme were using a height and width listed in the source html. The new theme will resize the images using percentages, so I need to remove all the height and width in the ...
0
votes
1answer
935 views

Dynamically adding Captions to images

I have a site where the author has included Amazon Affiliate links. They've done this by adding the URL to product images. I'm wondering if there's a way to add a function that will automatically add ...
0
votes
1answer
87 views

Move caption in on attachment page

I am looking for a way to edit the way Wordpress’ native gallery displays images when clicked on. Specifically, I need to move the title below the image. A more detailed explanation: I setup a ...
0
votes
1answer
270 views

Wrap a post image with a div if it doesn't have a caption

I've tried the below code to wrap a post image with a div and it works. The problem I'm having is if the image has a caption. It screws up the the code that is generated when a caption is set for the ...