I am having an issue when adding media to the wysiwyg editor. I need the caption text to be displayed but it isn’t being added automatically the way it does in the main editor window. Is there a way to have the image captions added in the wysiwyg editors? Thanks!
Ok, here goes for a more in depth explanation.
In the standard content editor when you go to insert media and upload an image. You are able to add caption text to the image. Once you click the insert into post button this text is displayed in the editor under the image as a caption(and then on the frontend it displays as a caption as well).
When I switch to the text view on the standard editor I can see a caption shortcode wrapped around the image.
However, when I am using a WYSIWYG field from ACF and I click insert media and upload an image, the caption doesn’t get added to WYSIWYG editor.
And I don’t see the caption shortcode if I view the text version of the WYSWIG editor.
Does that help any? Let me know if there is more information you need. Thanks for the help! And thanks for the plugin, it is the most useful plugin in my toolkit!
I’m having this issue as well. In the default WP Editor you get the “wp-cation” class added when the content is outputted to the site. With an ACF WYSIWYG editor it outputs the following:
<div> <dl id="attachment_166"> <dt><img title="Steve van Doren / BBC News" alt="" src="http://URL.com/new/wp-content/uploads/2012/11/NG_VFC_DTSD-110820-8864-600x400.jpg" width="600" height="400"></dt> <dd>Steve van Doren / BBC News</dd> </dl> </div>
I think it should output:
<div id="attachment_166" class="wp-caption aligncenter"><img class="size-medium wp-image-166 " title="Steve van Doren / BBC News" alt="" src="http://URL.com/wp-content/uploads/2012/11/NG_VFC_DTSD-110820-8864-600x400.jpg" width="600" height="400"><p class="wp-caption-text">Steve van Doren / BBC News</p></div>
Is there any more movement on this issue.
When our users add an image to a custom field (using add media), then add a caption to it, the output after updating (saving) ignores the WP img_caption_shortcode functon, so the raw code gets displayed.
I’ve just discovered that I’m also having this problem. Captions added to images in WYSIWYG field are not being assigned the .wp-caption class as they would be via the built in editor and calling the_content()
This isn’t a plugin or theme conflict, core and plugins all up to date as of todays date.
My captions for images added into wysiwyg fields have suddenly stopped appearing. A few days ago they were fine, I think, but today they are suddenly gone. In fact, WordPress is no longer wrapping the captioned images in a <figure> tag so the whole layout has gone awry. It is basically treating captioned images as uncaptioned images. I am not 100% sure it is not due to something I have done, but if anyone can give advice would be v grateful. All my plugins and theme etc are up to date. THe site is not live, it is on mamp, still being built.
If I add an image in the standard (non acf) wysiwyg, captions do appear.
I think I may have found the cause. Plugin called wp typography, if I deactivate it, the captions reappear. Not sure yet, maybe there is a compatibility issue.
The topic ‘Image Captions in WYSIWYG’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2022 Advanced Custom Fields.