Return to Snippet

Revision: 67350
at September 13, 2014 09:58 by chrisaiv

Initial Code
* Title: Detect Safari On iOS 
* @param string $role Role name.
* @param int $user_id (Optional) The ID of a user. Defaults to the current user.
* @return bool
function add_ios_styles(){
  global $is_iphone;
  if( $is_iphone ){
    wp_enqueue_style('iphone-css', get_stylesheet_directory_uri() . '/iphone.css' );
    wp_enqueue_style('common-css', get_stylesheet_directory_uri() . '/common.css' );
add_action('wp_print_styles', 'add_ios_styles');

Initial URL

Initial Description
It's probably not a good idea to always use this trick but if you need to, you'll be glad you bookmarked this script.

Initial Title
Wordpress: Detect Safari On iOS

Initial Tags

Initial Language