Used this theme for a very basic event website. On mobile (Nexus 5) the site just scales to the screen size, but the media queries do not kick in.

To solve this I added this to the html.tpl.php

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

Is this a good solution or should I do something else? It works for me...

Comments

capono created an issue. See original summary.

loparr’s picture

Hi, same here. This fixes the problem.

ruhanstander’s picture

There is an error in the template.php file.

Line 97 refers to the incorrect theme (medical):
function medical_page_alter($page) {

Replace line 97 with:
function parallax_zymphonies_theme_page_alter($page) {

Replace line 104 content with:
'content' => 'width=device-width, initial-scale=1.0, maximum-scale=1'

Or add this code to template.php in your sub-theme:

function theme_page_alter($page) {
  // <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
  $viewport = array(
    '#type' => 'html_tag',
    '#tag' => 'meta',
    '#attributes' => array(
    'name' =>  'viewport',
    'content' =>  'width=device-width, initial-scale=1.0, maximum-scale=1'
    )
  );
  drupal_add_html_head($viewport, 'viewport');
}

(replace theme with the sub-theme name)

HansKuiters’s picture

Status: Needs review » Reviewed & tested by the community

This is better! Thanks.

wavesailor’s picture

Thanks @ruhanstander - Works perfectly

zymphonies-dev’s picture

Status: Reviewed & tested by the community » Fixed

Updated changes in latest release.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.