I want to add this line above my title

<meta name="viewport" content="initial-scale=1.0, width=device-width,  minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />

How can I ?


You can put this on html.tpl.php in drupal 7 , else you can have it on page.tpl.php.

As a note if you are putting it on page.tpl.php remember you have to put it on every other page overriding template page--front.tpl.php etc.

| improve this answer | |

You can use the drupal_add_html_head() function. Add something like this to a page preprocess function:

$tag = array(
  '#type' => 'html_tag',
  '#tag' => 'meta',
  '#attributes' => array(
    'name' =>  'viewport',
    'content' => 'initial-scale=1.0, width=device-width,  minimum-scale=1.0, maximum-scale=1.0, user-scalable=no',
drupal_add_html_head($tag, 'meta_viewport');
| improve this answer | |

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.