Make WordPress Mobile Friendly
Following on my theme for this week, here are the steps to make WordPress mobile friendly. This assumes you are using a separate URL for your mobile friendly wordpress (such as sitename.mobi):
1 – Buy your domain and park it on your current WordPress site, so sitename.com and sitename.mobi are generating the same content
2 – Add (or modify) the file /wp-content/themes/yourtheme/functions.php and add the following lines:
<?php
remove_action(‘template_redirect’, ‘redirect_canonical’);
function elixir_urlrewrite( $url ) {
Brillant Dylan thank you
Nice article. I can and probably will do what you have suggested when I can scrape together for some .mobis. But what about people who don’t have the wherewithall to do this? What do you think about those sites like mofuse?
I haven’t tried it. I decided to give it a whirl and set up http://topsemtips.mofuse.mobi/.
For those who haven’t used mofuse.mobi its an application that reads the RSS feed for a site and allows a visitor to read your posts.
It looks like you can customize your feed with logos, colors, links, etc. You can even monetize your mofused site.
Personally I’m such a geek I like doing this stuff. If you’re not technically capable of doing the work (or can’t afford .mobi’s) then this might be an option.
It was nice, but I have checked wordpress have ready plug-in available, you just need to configure and it will be ready for mobile you same web site.
is there any difference between two?
I like .htaccess modification which will help a lot if you have two different domains.
Good luck 🙂 and Happy mobiling.
This code was primarily for two different domains (site.com and site.mobi), I’ve written previous posts about making your site look good for mobiles on just one domain, though that wasn’t written from a WordPress POV.
I installed the WordPress Mobile plug in http://www.andymoore.info/wordpress-mobile-plugin/#install and it looks good. If you don’t mind not having your own look and feel on the mobile friendly site this is an option. In fact I’ll leave it enabled on this blog which will save me re-writing my theme to be mobile friendly – saves me an hour. (see update at end of post).
For the http://www.fionndownhill.mobi site I wanted to have her face and the blog title at the top as I wanted to brand the site. The site also uses the CSS file from http://www.elixirinteractive.com to ensure the corporate site and the blog site stay similar look and feel wise.
Update:
I was casually perusing the code and noticed the following on line 582 (spaces added by me to stop the hyperlinking of the link):
a href=”http :// www . web2txt . co .uk/ wap /v2/order.php?product=’.$web2txt_id.'”>’.$web2txt_anchor.’ Ringtone
Turns out there some spam in the code though it looks like its only enabled if you don’t pay for the code, and don’t share ad revenue.
And there’s a whole host of code that’s labeled ‘we don’t want this going to validators or the w3’.
Guess you get what you pay for. I’ve now turned off the package, its easier to modify my site to be mobile friendly than to work through the code looking for gotchas.
Are there not wordpress plugins to handle all this???
Hi,
Whilst that solution would work for some phones, it wouldn’t work for a load of others. And having 2 domains, one for web and one for mobile is not really something that is practical.
The good news though is that I’ve created a mobile plugin for wordpress that works for all devices and allows you to have one single domain!
It’s called the Wapple Architect Mobile Plugin for WordPress and it mobilizes your blog. It works for every single device, from a WML phone to a brand new swanky phone with XHTML. Images are dynamically resized and you get the option to really customize your blog any way you want.
In addition, you can upload mobile logos and style your site so the mobile version matches the website and you retain your brand identity. You also get better and more control over your SEO than other mobile plugins.
If you fancy giving it a go, the URL is http://wordpress.org/extend/plugins/wapple-architect/ – it’d be great to hear your feedback!