Table of Contents

Theming Document Type

The document type declaration is required for your theme. This is certainly one of the easiest steps in creating a theme!


The theme engine loads the core/doctype.php file in your theme directory and expects to find the theme_page_doctype hook defined. Your hook should return the doctype string.


The following returns the old 4.01 transitional doctype.

function theme_page_doctype()
    return "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n";

A more modern HTML 5 example:

function theme_page_doctype()
    return "<!DOCTYPE html>\n";


content/en_us/dev_theming_document_type.txt · Last modified: 2015/03/02 17:05 by dloper

Page Tools