fixes #37 -- adding language_attributes() in header.php
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<!doctype html>
|
||||
<!--[if lt IE 7]> <html class="no-js ie6" lang="en"> <![endif]-->
|
||||
<!--[if IE 7]> <html class="no-js ie7" lang="en"> <![endif]-->
|
||||
<!--[if IE 8]> <html class="no-js ie8" lang="en"> <![endif]-->
|
||||
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
|
||||
<!--[if lt IE 7]> <html class="no-js ie6" <?php language_attributes(); ?>> <![endif]-->
|
||||
<!--[if IE 7]> <html class="no-js ie7" <?php language_attributes(); ?>> <![endif]-->
|
||||
<!--[if IE 8]> <html class="no-js ie8" <?php language_attributes(); ?>> <![endif]-->
|
||||
<!--[if gt IE 8]><!--> <html class="no-js" <?php language_attributes(); ?>> <!--<![endif]-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
|
||||
@@ -103,6 +103,24 @@ function roots_relative_feed_urls() {
|
||||
|
||||
add_action('pre_get_posts', 'roots_relative_feed_urls' );
|
||||
|
||||
// remove dir and set lang="en" as default (rather than en-US)
|
||||
function roots_language_attributes() {
|
||||
$attributes = array();
|
||||
$output = '';
|
||||
if (!defined('WP_LANG')) {
|
||||
$attributes[] = "lang=\"en\"";
|
||||
} else if ($lang = get_bloginfo('language')) {
|
||||
$attributes[] = "lang=\"$lang\"";
|
||||
}
|
||||
|
||||
$output = implode(' ', $attributes);
|
||||
$output = apply_filters('roots_language_attributes', $output);
|
||||
echo $output;
|
||||
}
|
||||
|
||||
add_filter('language_attributes', 'roots_language_attributes');
|
||||
|
||||
|
||||
// remove WordPress version from RSS feed
|
||||
function roots_no_generator() { return ''; }
|
||||
add_filter('the_generator', 'roots_no_generator');
|
||||
|
||||
Reference in New Issue
Block a user