Validating Your Theme
Validating the markup of your theme is the process of ensuring that the web pages conform to web standards defined by various organizations. These standards ensure web pages are interpreted in the same way by different browsers, search engines, and other web clients.
Conforming to standards and regulations is one of many ways you can make your theme universally understood. Make sure your code and styles validate across the board. That means they have to meet the standards set by the W3C Organization and pass a variety of validations for CSS and XHTML.
Not all validators check for the same things. Some only check CSS, others XHTML, and others for accessibility. If you are sincere in presenting standardized pages to the public, test them with several validators. The World Wide Web Consortium sets the standards and also hosts a variety of web page validators.
Validation Techniques
Validating your WordPress site means more than just checking the front page for errors. A theme’s template files are loaded in a modular fashion. While you may fix all the errors associated with the index.php
and sidebar.php
on your front page, errors may still exist within other template files such as single.php
, page.php
, archives.php
, or category.php
. Validate pages that load each of your theme template files.
Validation Checklist
To help you validate your WordPress site, here is a quick checklist:
- Validate your HTML / CSS / Feeds
- Validate accessibility – WCAG Guidelines, Section 508 Standards and WAI standards
- Check different browsers
- Re-validate HTML and CSS
Validate HTML
- The W3C’s HTML Validation Service (URL and upload)
- W3C’s Collection of Validators
Validate CSS
- W3C.org’s CSS Validator (URL, upload, and direct paste in)
Validate Feeds
- W3C.orgs feed validator (URL, and direct paste in)