Vladut
Vladut

Reputation: 657

How create mobile version for wordpress theme?

What is the best solutionom to create a theme in wordpress just for mobile? I create a theme what i like in wordpress but i want to change interface for mobile. I don't want to use a plugin from web.

I think 2 solution for my site but i don't know how to start. 1) To create an subdomain like m.mysite.com (but i don't know what how doing this) and to put another theme there. 2) To create a folder in my wordpress theme with name "mobile" and when a user has been connect from mobile, take him on mobile version.

For this i need documentation but i don't know from where to start. If exist another solution please tell me.

Thanks

Upvotes: 0

Views: 105

Answers (2)

drazewski
drazewski

Reputation: 2027

As Blackbam wrote the best idea for mobile version is to use responsive Theme. But you can also check some wordpress plugins. There are a some plugins which automatically detect whether the visitor to the site is mobile or not and they let you create a mobile version for your website. I think it should be easy and fast way to prepare some simple mobile version.

Upvotes: 2

Blackbam
Blackbam

Reputation: 19396

It is generally not a good idea to create a seperate Theme for mobile view as nowadays everybody should use responsive Themes. If you have a Theme which is not responsive you should either use a different Theme which supports mobile or you create a mobile version of your Theme.

If you decide for the second use CSS media queries to conditionally include mobile stylesheets:

<link type="text/css" media="screen and (max-width: 980px)" href="<?php bloginfo('template_url'); ?>/mobile/netbook.css" rel="stylesheet" />
<link type="text/css" media="screen and (max-width: 768px)" href="<?php bloginfo('template_url'); ?>/mobile/tablet.css" rel="stylesheet" />
<link type="text/css" media="screen and (max-width: 524px)" href="<?php bloginfo('template_url'); ?>/mobile/smartphone.css" rel="stylesheet" />

Alternativley (even better) include these conditionally with wp_enqueue_style().

For more information on how to make an existing Website or WordPress Theme responsive look at the following articles:

http://www.vandelaydesign.com/turn-any-site-into-a-responsive-site/ https://colorlabsproject.com/tutorials/make-your-wordpress-theme-responsive/

... an Google on "How to make a WordPress Theme responsive".

Upvotes: 2

Related Questions