WordPress.org

Support

Support » Themes and Templates » Modernizr – Add class to element

Modernizr – Add class to element

  • I need to be able to add the class ‘no-js’ to the ‘html’ element, hopefully using a simple filter or option in the functions.php file or the like.

    Basically I would prefer not to edit the template files.

    currently I am using the following in the functions file with thematic.

    function childtheme_create_doctype($content) {
    	$content = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n";
    	$content .= '<html xmlns="http://www.w3.org/1999/xhtml" class="no-js"';
    	return $content;
    }
    add_filter('thematic_create_doctype', 'childtheme_create_doctype');

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Modernizr – Add class to element’ is closed to new replies.
Skip to toolbar