Ready to get started?Download WordPress


[resolved] Adding captions to video embeds/iframes (3 posts)

  1. danpalehorse
    Posted 9 months ago #

    Hi there,

    I'm currently trying to add captions to video embeds, with no joy.

    I've coded the theme to display image captions successfully, and I would like to do the same for video embeds - display a subtitle.

    Dues to the nature of the theme, I can only do it with attachment-based code, so I need to find some way to tell wordpress to display chosen text beneath the video, that correlates to a css class, and caption seems to be the obvious choice.

    Ideally I would like shortcode to add a caption to the video, but I can't find a way to get it working (if I copy and paste the shortcode from images, the attachment id is wrong, and I can't find a way to get the id of the video).

    Any suggestions on this greatly appreciated.

  2. Media X
    Posted 9 months ago #

    Did you try this or this ? It works on my test site.

  3. danpalehorse
    Posted 9 months ago #

    Ah great that worked a treat - thanks.


You must log in to post.

About this Topic