Skip to content

Instantly share code, notes, and snippets.

@jlavialle
Forked from sebcunin/gist:6027300
Created August 27, 2013 12:46
Show Gist options
  • Select an option

  • Save jlavialle/6353043 to your computer and use it in GitHub Desktop.

Select an option

Save jlavialle/6353043 to your computer and use it in GitHub Desktop.
<?php
/**
* Ajouter les méta spécifiques aux Devices Apples
* */
function THEME_NAME_preprocess_html(&$variables) {
//regular apple-touch-icon
$apple = array(
'#tag' => 'link', // The #tag is the html tag - <link />
'#attributes' => array( // Set up an array of attributes inside the tag
'rel' => 'apple-touch-icon',
'href' => path_to_theme() .'/apple-touch-icon.png',
),
);
drupal_add_html_head($apple, 'apple-touch');
// 72x72 apple-touch-icon
$apple = array(
'#tag' => 'link',
'#attributes' => array(
'rel' => 'apple-touch-icon',
'href' => path_to_theme() . '/apple-touch-icon-72x72.png',
'sizes' => '72x72',
),
);
drupal_add_html_head($apple, 'apple-touch-72');
// 114x114 apple-touch-icon
$apple = array(
'#tag' => 'link',
'#attributes' => array(
'rel' => 'apple-touch-icon',
'href' => path_to_theme() . '/apple-touch-icon-114x114.png',
'sizes' => '114x114',
),
);
drupal_add_html_head($apple, 'apple-touch-114');
...
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment