I love the Quick Adsense plugin. It makes life easier for people who would like to run Adsense on their blogs without fussing around codes, apart from the initial setup of ad codes and where you want Quick Adsense to insert them to. It worked really well and I didn’t have any issues with it.
In order to make Passive Income Blogging more accessible to mobile users, I installed the WPtouch plugin to create a mobile & tablet optimized version of my website that works well for iPhones, iPads, iPod Touches, Android, Blackberry and other smart gadgets.
The mobile version rendered by the WPtouch plugin, showed the Adsense ads in its normal sizes which were too big for small-sized mobile gadgets. I didn’t want to get in trouble with Google but I also wanted to keep the mobile version. I decided to try and search for possible workarounds. I looked through the Quick Adsense plugin site but there was no solution provided to disable Quick Adsense on WPTouch or WordPress Mobile Pack themes.
I found the solution to my problem when I found an article about disabling easy-adsenser when WPtouch is active. The author provided the following code that needed to be added to the Easy Adsenser plugin’s PHP file:
if (function_exists('bnc_wptouch_is_mobile') && bnc_wptouch_is_mobile())
return $content ;After reading a comment from the Quick Adsense site that the additional code can be added at the beginning of process_content() function inside the quick-adsense.php file, I decided to try it. I opened the text editor and edited in the code so it looked like this:
if( (is_feed()) ||
(strpos($content,'<!--NoAds-->')) ||
(strpos($content,'<!--OffAds-->')) ||
(is_single() && !(get_option('AppPost'))) ||
(is_page() && !(get_option('AppPage'))) ||
(is_home() && !(get_option('AppHome'))) ||
(is_category() && !(get_option('AppCate'))) ||
(is_archive() && !(get_option('AppArch'))) ||
(is_tag() && !(get_option('AppTags'))) ) {
$content = clean_tags($content); return $content;
}
if (function_exists('bnc_wptouch_is_mobile') && bnc_wptouch_is_mobile())
return $content ;
$AdsToShow = get_option('AdsDisp');and crossed my fingers before hitting save. I then refreshed my site and waited if my blog would crash. Since it didn’t die, I decided to check using my iPod Touch to see if it worked. I was glad to see that after adding the code, the single post ads had disappeared on the mobile version. It’s now easier to read the articles and I don’t need to worry about getting in trouble with Google. I just need to remember to edit the code again in case there is an update to the Quick Adsense plugin. ![]()