When a huge percentage of your visitors are on mobile phones, you definitely need to optimize your site for mobile view to encourage them to keep visiting. Also, there’s need to monetize your mobile traffic by inserting inmobi, admob, buzzcity or google adsense for mobile ads to make some extra income. There are several plugins to make your wordpress blog mobile which includes WordPress Mobile Pack but the one I prefer most is MobilePress. If you try visiting this blog on mobile, should see the mobile version exactly as shown below.
MobilePress allows you to insert google adsense, inmobi and admob ads into your WordPress mobile site but it can only be done through Aduity, a third party site. I’ve been trying to visit aduity since I installed MobilePress but the site is never available. I’m not sure if the problem is temporary or they’re totally off the internet and not coming back. Anyway, I had to insert inmobi and google adsense for mobile ads and finally figured out a way to do it.
To get this done, you have to directly edit your MobilePress theme by logging in to your cPanel or fetching the needed files through FTP.
1. Log in to cPanel file manager or use your FTP login details to access your file manager from ftplive.com
2. Copy your ad code to a text file and save as adsense.php, inmobi.php or admob.php depending on your choice.
Note that if you’re creating a google adsense for mobile unit, you shouldn’t select ads for high end phones only, your selected ad type should be one that would be for both high end and low end phone. This code is in php which is preferable because it can be rendered on all phones.
The same thing goes for inmobi, buzzcity, admob and others, just copy the code to a notepad and save.
3. Upload this to public_html
4. Go to /public_html/wp-content/plugins/mobilepress/themes/default
If you’re using a custom theme, the directory should be /public_html/wp-content/mobilepress/themes/themename
Here, we’re dealing with just two files depending on where you to display the ads: header.php and footer.php .
5. If you want the advert to display at the top, you’ll have to edit header.php and insert the ad where you want it to display with php include function. Preferably, paste this in the very last line:
You can as well use this code anywhere else you want to display the advert in your WordPress mobile theme.
6. If you need to show the ad unit at the footer, edit footer.php and paste that same code on the very first line.
7. You may also edit single.php file if you wish to place the ad on your post pages. Look for this:
And place the ad before or after it depending on whether you want the advert to show above or below your articles.
8. Now check your wordpress site on mobile to see if the ads are displaying. If not, give it some time before checking if you made a mistake. Inmobi sometimes takes up to theee days before displaying but adsense for mobile takes less than 10 minutes
It isn’t a bad idea customizing the look of your MobilePress if you know a bit of CSS. You can toy around with the CSS in the head section just to give it a unique look since you cant find MobilePress templates around. You can as well add some category links at the header to make navigation easier and all you’re deling with here is purely HTML. Just write the links where you want them to show.
If this post helps, hitting the google plus one or facebook like button is a great way to say thanks!