WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently writing a plugin that displays some images - possibly with captions. So, I was wondering whether to use XHTML (<div>s and <span>s) or HTML 5 (<figure> and <figurecaption>) for output.

I image that the answer to this question depends somewhat on the theme being used. Is there a way to figure out which output format the user's theme is using? Or what's the best approach here? What's Wordpress doing to solve this issue?

share|improve this question
up vote 5 down vote accepted

WordPress will not help you here. In back-end use conservative XHTML 5: <br />, but not <figure> (see WP coding standards).

In front-end … it is hard to determine the Doctype and the usage of polyfills, so stay with regular HTML as long as possible or load the necessary polyfills from your plugin.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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