Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+6 votes
in Plugins by
Most of my visitors uses mobile handsets to browse websites. Its like more than 30% come to my Q&A website using xhtml browsers. I want to add google adsense mobile ads code into my website but problem is that this code is in PHP. Is there any plugin or we would have to implement it in core files. Any help??
Q2A version: 1.5.4

2 Answers

+4 votes
selected by
Best answer


You would probably need a mobile theme, I would recommend this: https://github.com/NoahY/q2a-mobile-theme

Open the theme and edit qa-theme.php on line 11 add this:  $this->output('<YOUR ADSENSE MOBILE CODE>');

  - This will output adsense ads below your Logo/Site title


Then from Admin > General settings area of your site, make sure the mobile theme is activated for Theme for mobiles

Experiment with more positions see what suites you best.


Thanks for the help Bak :)
0 votes
How to put adsense mobile ad below heading. <h1>..</h1>

Open qa-theme.php in your mobile site theme folder and add the following function:

function title() // adsense after the page title
                $this->output('YOUR ADSENSE MOBILE CODE');
Google mobile ads code are in php. Its syntax is like <?php ...... ?>
And when I am putting this code. It is giving me syntax error.
Sorry, Google Mobile service is not available in my country yet. I thought the ads would be in same format as web ads.

Am using this method with Chitika ads and its working fine on my site