Creating a mobile version of your WordPress website is really important in this age of the technology. I wrote a post back in January about creating a mobile version of your WordPress website in three different ways. Your audience will love to access your content on their mobile devices. However, you’re just not earning anything from all the mobile viewers.
Earning mobile is not the most important part of blogging, but you need to pay for your hosting and services, so it’s an important part of it. I’m not saying that you should fill your mobile website with various pop-ups and redirection, but adding a few Adsense mobile units to your MobilePress powered website in not a bad idea.
In this article, I’ll show you how to properly generate and insert Google Adsense ads into MobilePress powered mobile version of your WordPress website. I did some testing on a MobilePress-WordPress website of mine, and found out that my MobilePress version earns about 30% of my Adsense revenue. So, it does make sense to insert a couple of Google Adsense ads to your MobilePress.
Create Adsense Mobile Ads Unit
You just can’t add those large skyscraper to your mobile version, so you need to generate a mobile ads unit of your Adsense for the mobile version.
Login to your Google Adsense account and click on My Ads link from the top navigation menu. Now, navigate to the Mobile content, and click on New ad unit button.
It will take you to a form, where you’d have to fill all the details of your new mobile ad unit. Fill ad unit name, format, type and choose PHP (v4.3.0 or greater) as the scripting language.
Save and get the code of your ad unit. Copy the code and save in into a new file named adsense.php. We will need this file later in this tutorial.
[alert style=”yellow”]Note: You can do the same with any other publisher platform to insert its ads to your MobilePress.[/alert]
Insert Ads Into MobilePress Theme
Now, we will upload our advertise code file into our hosting account and then we will link it in our MobilePress theme.
Upload the adsense.php into the root of your hosting storage using ftp or file manager.
Go navigate to /wp-content/plugins/mobilepress/system/themes/default or whatever theme you’re using with your MobilePress.
Now, this directory contains all the theme files of MobilePress. You can now add your ad unit to any theme file that you want. I’d recommend you to add your Adsense mobile unit to header.php and footer.php file of your theme.
Edit header.php and footer.php file and insert the ad where you want it to display with following snippet:
<div class="adsense"><?php include('adsense.php'); ?></div>
That’s it! Now, you’ll see a bit white space on your mobile website for sometime, because it takes few hours for the ads to appear on your website. Plus, these ads will only appear from a mobile device, not from your computer.