Comment on SEO AdSense WordPress Theme by SEO Dave.
This would be possible without having to hack any code using the Display Widget option and a Text Widget with an AdSense ad within it.
This would give you full control over which posts and archives the ad is shown on.
Stallion Layout Options : Widget Display ON
Go to your Google AdSense account and create an AdSense ad with whatever ad size, colours etc… you want to use (this is building an AdSense ad outside of Stallion).
Add a Text Widget to the “Content Ad Widget” area and put the AdSense ad code into a Text Widget.
The Content Ad Widget area is the same location as the floating AdSense ad unit, so by doing the above you’ve added an extra AdSense ad unit in the floating area. Go to Stallion AdSense Options and set Ad Unit 1 to Off, so we only have the one AdSense ad in the floating area, this will disable the main AdSense ad sitewide.
I think the Content Ad Widget area lacks formatting (next Stallion update which development is currently paused has float left/right and center align). So you’ll probably have to add a float left or right div around your AdSense code to match the main AdSense content alignment.
Since we turned Widget Display ON the text widget that holds your new AdSense ad code can be set to be shown/hidden on various parts of the site. You can also add more than one text widget with AdSense code or other ads and set them to load on different parts of the site. I use this technique for linking out from the sidebar from the home page and archives to relevant pages on my other sites.
I create a text widget and manually add text links to it (basically manually build a Blogroll code), if I want the links only to show on the home page I set the hide/show widget options to Show on checked and tick Miscellaneous +/-: Front Page. If I want the links only to show on one category, but not on the single posts I set the hide/show widget options to Hide on checked and tick every box under Miscellaneous +/-, Pages +/- and all categories under Categories +/- except the category I want the links to load under. This way I can have blogroll links loading on just one category, I add a text widget with a manually generated blogroll for each category and the home page so each section links to different stuff. Unfortunately you can’t set a combination of hide and show, if you set a widget to Show on checked and tick one category it will load the widget on that category and all the posts within the category (not ideal for links). That might be OK for what you want to do, if all the posts you want an AdSense ad to show on are all in the same categories it’s a few ticks and your done. Same if you want them hidden on the home page and most categories it’s easy to do.
For single posts there’s the override layout settings on each posts edit screen, Stallion Layout and Colour Scheme Options – Disable All Ads. but this disables all ads except the widget ones, so not exactly what you want.
You could also use this code that hides the main content ad unit
<style>.stallionhideads {display:none !important;}</style>
Added to a text widget and use the display widget options to load it on the parts of the site you want the Adsense ad hidden on. For example set to Show on checked and tick the Front page box would hide the main AdSense ad on the home page, but the rest of the site would show ads.
You might also find the Stallion Single Posts widget useful as well. Add this to a widget area and on each Post edit screen at the bottom is the equivalent of a text widget you can add code etc… If you wanted the main AdSense ad disabled sitewide and you select individual posts you want ads on you could use this widget area. Good option if you say have a 100+ page site and only want an ad on say 5 posts.
BTW the code you couldn’t find in the index.php file is in the content.php file and content-*.php files if you use the post types. WordPress added the ability to change the main body content based on posts types like image, gallery, quote etc… and each one has it’s own content-*.php file, so each one has it’s own AdSense code. If you don’t use the post types on the post edit screen, editing the content.php file would disable the main AdSense ad for all archives and single posts.
David
More Comments by SEO Dave
AdSense Theme Options
AdSense Responsive Theme Code
Code doesn’t come through in WordPress unless you add code tags, so didn’t see your code, have pasted what it should look like to replace the messed up code.
If your code looks like that, should work. Must be exactly like …
Continue Reading Stallion AdSense Theme
AdSense Theme Options
Google AdSense Custom Search Widget
The Stallion Responsive 8.2 version of the Google AdSense Custom Search Widget is called “Stallion AdSense Google Search Widget”.
For performance reasons some of the Stallion widgets and default WordPress widgets are disabled. Basically if you don’t use a widget it’s …
Continue Reading Stallion AdSense Theme
AdSense Theme Options
DED : You’ve Reached your Daily Relay Quota
Yep, Google changed a while ago to show users what they are searching for as ads. Can get quite irritating when doing research, shows me ads I have no interest in: not that I ever click AdSense ads on any …
Continue Reading Stallion AdSense Theme
AdSense Theme Options
How to Remove Malware Ads
Had a look at the home page code and the code of a WordPress post and don’t see anything obvious untoward.
I see the correct AdSense ads when viewing your site, I saw some ads about roofing and others about SEO …
Continue Reading Stallion AdSense Theme
AdSense Theme Options
AdSense Troubleshooting
Assuming you are running either Stallion Responsive or Stallion WordPress SEO.
Most times AdSense doesn’t work it’s because the user has inadvertently copy pasted additional characters (tabs or spaces) which breaks the code.
Check before and after for spaces, should only be:
pub-123456789
Assuming …
Continue Reading Stallion AdSense Theme
AdSense Theme Options
Adding HTML code to a WordPress Post
Have you viewed the HTML source of the AdSense output that’s not working and compared it to the original AdSense code?
This will tell you if it’s WordPress changing your HTML after saving.
Easy to do.
Add the responsive ad code that isn’t …
Continue Reading Stallion AdSense Theme
AdSense Theme Options
Adding Responsive AdSense Code to a WordPress Post
When you say adding a Responsive AdSense ad to a WordPress page do you mean editing a page template (one of the files ending .php) and manually adding the AdSense code where you want it?
Or editing a WordPress Page or …
Continue Reading Stallion AdSense Theme
AdSense Theme Options
Advanced AdSense Responsive Ad Units
I need to get more sleep apparently, managed to replicate your issue by using the Smart Sizing AdSense Responsive Ad Code.
Where ever I suggested using Smart Sizing AdSense Responsive, should be use Advanced AdSense Responsive ad units and delete the …
Continue Reading Stallion AdSense Theme
AdSense Theme Options
Responsive AdSense Advanced Code
Edited comment to take into account completely getting it wrong, I advised using Smart Sizing should be use Advanced AdSense code with Stallion!
The difference between the two AdSense Responsive Ad Unit types is as follows, the two code examples are …
Continue Reading Stallion AdSense Theme
AdSense Theme Options
AdSense Responsive adsbygoogle.js File
One possibility is you are using broken AdSense code.
The AdSense responsive code I use on this site lacks this code:
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
Which means my AdSense ads code is broken (incomplete), but because Stallion Responsive includes the adsbygoogle.js code link it …
Continue Reading Stallion AdSense Theme
AdSense Theme Options
Responsive AdSense Ad Units Placement
The main Ad ON/OFF options are designed for the built in AdSense code including what you add on the main Stallion AdSense Options page form boxes. If an ad is turned off on the main AdSense options page that ad …
Continue Reading Stallion AdSense Theme
AdSense Theme Options
AdSense Responsive Ad Units
Updated to take into account a brain fart, see later comment.
Sounds like you are using the widget area correctly.
I’ve just tested two scenarios that worked as expected (update: I was wrong).
On this website under “Appearance” >> “Widgets” made sure I …
Continue Reading Stallion AdSense Theme