Best 2 Know

The Ultimate Blogging Resource

  • Advertising
  • WebHosting
  • Contact Us
  • Blogger
    • Blogger Templates
    • Blogger Tutorials
  • Browser
    • Firefox
    • Google Chrome
  • Google
  • Internet
    • Facebook
    • Twitter
  • Thesis
  • Windows
  • WordPress
    • WordPress Themes
    • WordPress Plugins
  • More
    • Linux
    • Review
    • Solutions
    • Announcements

How to Detect Safari Browser on iOS

Well Safari browser is been used on many platforms, like MacBook, IPad, IPhone and etc. so how to check if the user is coming from IPhone or IPad and give him a different design or stylesheet, well that is pretty simple their is a variable in WordPress that allows us to detect whether the visitor is from the iPhone

So here’s the simple code for using in your WordPress site :

add_action('wp_print_styles', 'wpden_iphone_enqueue_styles');
function wpden_iphone_enqueue_styles(){
	global $is_iphone;
	if( $is_iphone ){
		wp_enqueue_style('iphone-css', get_stylesheet_directory_uri() . '/iphone.css' );
	}
	else{
		wp_enqueue_style('default-css', get_stylesheet_directory_uri() . '/default.css' );
	}
}

well the above code is pretty simple to understand that detect safari so i guess i do not need to give any such kind of explanation if you need more help, leave a comment below

Subscribe via Email

Share this:

  • Twitter
  • Facebook
  • Pocket
  • Print
  • WhatsApp
  • Email

Related

March 6, 2012 Ritesh Sanap WordPress CSS, Detect Safari, Hacks, iPhone, Safari, wordpress hacks

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Post navigation

Previous Previous post: How to Create MultiBoot Flash Drive
Next Next post: Show Featured images in Feed

Currently Trending

  • How to download Specific parts of YouTube videos
  • How to Change the Welcome/Login Screen in Windows XP ?
  • h4x0r ( Hacker ) - Blogger Template
  • Windows Vista CD key
  • Add/Remove page/Post View Counter Widget For Blogger
  • Free Online Angry Birds game
  • How to Make Your Own Avatar
  • How to Download Documentation for offline viewing - Dash
  • How To Change Windows XP Shutdown Dialog Box

Get Latest post in your Inbox

Random Posts

Trily – Blogger Template

May 30, 2010 By Ritesh Sanap 28 Comments

How To Make Your Own Run Commands : Must See

March 1, 2009 By Ritesh Sanap 1 Comment

How to recover you hard disc ?

June 7, 2009 By Ritesh Sanap Leave a Comment

Windows Vista CD key

August 25, 2009 By Ritesh Sanap 39 Comments

Hack Window’s Xp Password

January 16, 2008 By Ritesh Sanap Leave a Comment

WordPress

HTTP2 Server Push for W3 Total Cache Minify plugin

August 17, 2016 By Ritesh Sanap 5 Comments

How to Disable Emojis in WordPress

January 6, 2016 By Ritesh Sanap Leave a Comment

JetPack Related posts and Sharing not working with NGINX

November 10, 2015 By Ritesh Sanap Leave a Comment

Simply Pure – WordPress Theme

November 2, 2014 By Ritesh Sanap 2 Comments

Advanced What should we Write about next? – WordPress Plugin

July 28, 2014 By Ritesh Sanap Leave a Comment

How to Disable Self Pingback or TrackBack

January 16, 2014 By Ritesh Sanap Leave a Comment

BlueStrap – WordPress Theme

January 1, 2014 By Ritesh Sanap 15 Comments

How to Create Multiple Excerpts in WordPress

December 24, 2013 By Ritesh Sanap Leave a Comment

How to Disable Auto Update in WordPress

November 21, 2013 By Ritesh Sanap Leave a Comment

How to Delete Feedbacks from JetPack Contact Form

November 19, 2013 By Ritesh Sanap 9 Comments

Recent Posts

  • HTTP2 Server Push for W3 Total Cache Minify plugin
  • How to show hidden files and folders in Mac OS X
  • How to Disable Emojis in WordPress
  • Canva – Online Photo Editor
  • JetPack Related posts and Sharing not working with NGINX

Archives

Recommends

  • DigitalOcean – Cloud Hosting
  • Dropbox – Cloud Storage
  • Elegant Themes – WordPress Themes
  • LastPass – Password Manager
  • Like us on Facebook
  • Follow on Twitter
  • +1 on Google
  • Subscribe via Email
  • RSS Feed

© 2023 Best 2 Know · All Rights Reserved · We ♥ DigitalOcean