-1

I have a website, example.com, and I want to know if there is a way when a mobile user visits it, it will automatically change to the mobile version. I want the mobile version to be a different layout to my current website, as a mobile version it would really work.

The only problem I see now is, I have a page for each thing I want to show, and I use PHP includes.

vhu
  • 11,219
  • 11
  • 35
  • 42

2 Answers2

0

Have a look at Simplest way to detect a mobile device.

You can then have your CSS inserted conditionally.

Also you can provide another template based on the evaluation if it's a mobile device. But that requires you to use something like HTML templates for your site.

Another way would be to have to different sites and insert the mobile device query into the desktop site. If a mobile device views this site it gets forwarded to the mobile site. There are different approaches like this to do that.

Community
  • 1
  • 1
Bertram Nudelbach
  • 1,573
  • 2
  • 13
  • 26
0

Use Bootstrap.. it's a great framework for mobile first websites.

http://getbootstrap.com/

Janey
  • 1,120
  • 2
  • 14
  • 35