2

How can i add this meta tag in my website :

<meta http-equiv=“content-language” content=“en-us”> ?

I am using metatags module but i dont see any option about this. Is there any other way to do it?

Thank you

3

Hope this will help you,

In Drupal 7, you can achieve it using template_page_alter

    function THEME_NAME_page_alter($page) {
        global $language;
        $lang_name = $language->language;
        $meta_language = array(
          '#type' => 'html_tag',
          '#tag' => 'meta',
          '#attributes' => array(
            'http-equiv' => 'content-language',
            'content' => $lang_name
          )
        );
        $meta_content_language = array(
          '#type' => 'html_tag',
          '#tag' => 'meta',
          '#attributes' => array(
            'http-equiv' => 'language',
            'content' => $lang_name
          )
        );
        drupal_add_html_head($meta_language, 'content-language');
        drupal_add_html_head($meta_content_language, 'language');
    }

  • Folder listing of active theme folder

    enter image description here

  • template_page_alter inside template.php file

    enter image description here

Source

  • I am newbie, where do i put this code? – drupspark Aug 1 '13 at 17:11
  • Go to your ACTIVE theme - template.php file and add paste the above function. And don't forget to change THEME_NAME with your ACTIVE theme. – inizio Aug 1 '13 at 17:21
  • I have updated my answer check it. – inizio Aug 1 '13 at 17:47
  • It doesnt seems to work. I double checked if i did correct... – drupspark Aug 1 '13 at 18:03
  • Your welcome, enjoy :) – inizio Aug 1 '13 at 20:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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