I used wp_oembed_get function to embed a YouTube video. It worked like it should.

Now I want to add a class to an embedded element. Is there an argument for this?

Can't find list of arguments for this function anywhere. I tried 'class' but it didn't work.


The whole idea of embedding is that you do not have control over how the embedded content is being styled and it is controlled by the server from which the content is embedded. The embedding server might allow some control over the embedded content via the URL parameters but to know how to achieve that you will have to consult the documentation of the provider.

You can enclose the embedded content in a div with whatever class you want, but that unlikely to help you much.

| improve this answer | |
  • I was trying to achieve the structure that was set by the front-end dev. Now I understand that it was this structure that didn't make much sense. In fact he had a wrapping div and also a class for iframe... – Boykodev Jan 27 '16 at 8:39
  • In theory, for embedding providers that gives you actual HTML you can do some manipulation but I think most of them use iframes. – Mark Kaplun Jan 27 '16 at 8:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.