views:

526

answers:

4

Is there any way to do this?

My website is http://kennethreitz.com. Its driven by some moderate PHP on top Wordpress.

My options are to detect if the user is using an iphone, and if they are either

a) tell wordpress to load a different "theme" that i have written. b) if this isn't possible, have a different wordpress installation on a subdomain (i.kennethreitz.com) that operates out of the same database, that uses a different theme.

I'd rather be able to do A for SEO reasons.

Any ideas?

+2  A: 

Have you looked at iWPhone?

It's a Wordpress plugin and theme that automatically takes care of detecting whether the visitor is from an iPhone and formats things appropriately. Pretty easy to substitute your own custom iPhone CSS if you want, although the basic theme is pretty decent.

There's also WPTouch which looks to be similar in functionality but is a bit more recent and has better administration integration.

Ramin
WPTouch is my current solution. I want to create my own implementation.
Kenneth Reitz
A: 

I don't have experience with WordPress, but the iWPhone plugin + theme looks like it might work

rpetrich
A: 

Out of the box you cannot do either A or B.

Loading a different theme is not possible as that option is stored in the database under the wp_Options table. This setting is site wide not per user. Option B is not an option either since you would be sharing the same database you would be selecting the same value for the theme.

If you look in the wp_options table the theme setting will be found in the record that corresponds to "template" and "stylesheet".

gsirianni
A: 

Here is a Wordpress plugin which serves different themes to different browsers (e.g. iPhone):

http://code.kuederle.com/browserbasedthemes

Oliver