{"id":4965859,"date":"2014-05-30T21:08:13","date_gmt":"2014-05-30T21:08:13","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/captions-not-shown-in-script-generated-html\/"},"modified":"2016-08-21T21:06:29","modified_gmt":"2016-08-21T21:06:29","slug":"captions-not-shown-in-script-generated-html","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/captions-not-shown-in-script-generated-html\/","title":{"rendered":"Captions not shown in script generated html"},"content":{"rendered":"<p>I have the following problem:<\/p>\n<p>I inserted an image into a page using the visual editor<br \/>\nI gave it a caption, an alt-Text and I set Link to: image url<br \/>\nNow the image is shown on the page with the caption and if I open it, it is shown in an overlay (I noticed that the fact that it opens in an overlay is somehow depended on the presence of a caption, I don&#8217;t know why.)<br \/>\nNow, I create the html-code for my wordpress pages with a script, and I used the following code for images I found in the source code of the page generated by wordpress after I did the above steps:<\/p>\n<p><code>&lt;div style=&quot;width: 1345px&quot; class=&quot;wp-caption alignnone&quot;&gt;&lt;a href=&quot;image file here&quot;&gt;&lt;img src=&quot;image file here&quot; alt=&quot;Alt Text&quot; width=&quot;1335&quot; height=&quot;979&quot; \/&gt;&lt;\/a&gt;&lt;p class=&quot;wp-caption-text&quot;&gt;Caption Text&lt;\/p&gt;&lt;\/div&gt;<\/code><\/p>\n<p>If I paste my html code into the WordPress HTML Editor and save the page, I get the image with the caption, but it does not open in an overlay, but when I click on it, the browser just loads the image file itself.<br \/>\nIf I then go to the wordpress html editor, the code above is there alright. However, if I switch to the visual editor and click on the edit button on the image, the caption field is empty.<\/p>\n<p>Does anyone of you know what&#8217;s going on here? Why is the image not opened as an overlay? And Why does the wordpress image editor not show the caption?<\/p>\n<p>Any suggestions welcome!<\/p>\n<p>WordPress 3.9.1 with Responsive Theme 1.9.6.0 and Foobox Free Version<\/p>\n<p>EDIT: if you want to take a look at the page itself, it is this: <a href=\"http:\/\/ride.i-d-e.de\/issues\/issue-1\/nietzschesource\/\">http:\/\/ride.i-d-e.de\/issues\/issue-1\/nietzschesource\/<\/a><\/p>\n","protected":false},"template":"","class_list":["post-4965859","topic","type-topic","status-closed","hentry","topic-tag-captions","topic-tag-visual-editor"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4965859","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4965859\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=4965859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}