Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+7 votes
4.6k views
in Plugins by
recategorized by

Okay, here's a mobile theme.  It's pretty simple.  Probably lots of people want something totally different, so before you ask, I don't even have a mobile device to test this on.  If you want me to work on it, first send me a mobile device :Pā€‹   
ā€‹   
Otherwise, consider this a DIY project.  It's here:ā€‹   

https://github.com/NoahY/q2a-mobile-theme

The best way to use this theme is with something like the theme-switcher plugin, here:ā€‹   

https://github.com/NoahY/q2a-theme-switcher

And turn on the mobile theme recognition.

Here's a mock-up screenshot, but ymmv:


by
Wow, no comments even?  That bad?  That good?  Still waiting for some feedback; as I said, I don't have a device to test this on, so it would be nice to hear how it works.
by
Thanks for the theme. I was looking for mobile theme; will test and update you.
by
IMO a separate theme for mobile is not worth it (since you need the theme switcher as well). Better to use media queries or a mobile stylesheet to add  some different CSS for phones. I started working on something a while back but never got round to finishing.
by
I will test and report on iPhone 3G (safari browser) soon. What do you mean by "consider this a DIY project" means that theme and plugin is not stable ?
by
@Scott - I think the theme/plugin is a better way to go, since it allows for things like switching to full site, and it means mobile themes are swappable; if someone develops a better mobile theme, you just replace it.

@Another one - sorry, I just meant to say if you want it to look different, change it yourself.  It's all pretty stable, though one of our users reported that after visiting the site on her phone, she was directed to the mobile theme on her computer as well... I can't reproduce that, and it looks like the code won't do it, but there may be a bug I can't see.
by
So i tried plugin+theme but automatic mobile detection isn't working, i see same theme on my iPhone, safari browser (iOS 4.1 if it's matters) that on computer. Enabled mobile theme in admin settings.
by
That's funny... it is working here for that phone/browser combo (at least faking it works).  

If you have a theme set in your profile, it will use that theme instead of the mobile theme - the key to knowing whether it recognizes your mobile device is if there is a link on the footer to "Mobile Site" or "Full Site", both of which will only appear if it recognizes a mobile device.
by
Maybe it's becouse i modified my default theme or i'm rewrited nav_user_search... that may be fault from my side.
by
well, the recognition isn't perfect... do you see the link in the footer?

Also, if you can get me the output of

error_log($_SERVER['HTTP_USER_AGENT'])

for your device, I can test it at my end, since that's primarily what we're testing against.
by
Ah, I think I see what is wrong... it wasn't working if you only select the mobile switcher option... if you turn on the theme switcher function it should work, sort of.  I've fixed this now, I think; please update the code and let me know how it goes.
by
Now working, thanks :)
by
is there any additional steps to get it working?

i have downloaded the theme and the plugin, placed both in the appropriate directory, however, i dont see the style switcher in the footer, and i dont see mobile theme when tested from Samsung Galaxy S2 browser.
also, on mini opera demo site http://demo.opera-mini.net/public/

it shows the normal theme.

my site url is  : http://www.kalaaam.com/
by
using 1.5+ you need to enable mobile theme switching in admin

1 Answer

+2 votes
by
Fantastic theme and plugin !!! Thanks

The only comment I have is that the extra code I add on top, for adsense, appears also in the mobile theme, where it looks a bit odd.

Thanks for the great work :)
by
I didn't explain well. In Q&A you have the opcion to add HTML code in Layout. This can go up or down the pages, or on the side.

IMHO, the mobile theme should ignore this extra HTML code.
by
ah, gotcha.  I'll look into it...
by
I don't think it would be right to remove the main and full widgets... the side widgets are already removed along with the sidebar; what if someone wants to keep the widget in the mobile theme?

You're better off just adding a custom call like I mention above, or else a css to set display:none in the mobile theme; otherwise, someone will complain that the theme removes their widgets :)
by
ok, will try to do that. I still think that the mobile theme should do that automatically, but I guess you are right, some people would complain .. :D
...