Stallion WordPress Theme AdSense Setup – Updated for Stallion 7.1.1

Update for Stallion Responsive soon…

Log into your sites WordPress Dashboard after installing the “Stallion Theme” via the “Appearance” >> “Themes” page and on the left menu click:

“Stallion Theme”

This opens the main Stallion options page (labeled “Stallion Theme”). If you’ve not registered Stallion with your unique Stallion ID, please do so now, you can not save any options settings before registering.

When the Stallion theme is registered change the “AdSense Publisher ID” setting to your Google AdSense Publisher ID.

The AdSense ID listed by default is mine : pub-8325072546567078

How to Find your Google AdSense Publisher ID

You can get your AdSense Publisher ID from your Google AdSense account when you log in.

Click the circle like icon on the right side, followed by “Settings”, followed by “Account Information” and you’ll see your Publisher ID (see screenshot below).

Google AdSense Account

With the Stallion theme you can use pub-######## or a ca-pub-######## number, copy this code (doesn’t matter if you keep the ca- or not) and paste it into the “AdSense Publisher ID” box.

AdSense Publisher ID

Make sure you do not inadvertently copy a space/tab before or after your AdSense ID, it will break your AdSense ads (please check there’s no space/tab, get quite a lot of support requests for this copy/pasting mistake).

Click the “Save Settings” button and basic AdSense is setup so you receive the ad revenue. If all you plan to use is AdSense and you are happy with the default colours, placements etc… that’s all you have to do, all other AdSense settings are optional.

On the main Stallion options page you can also turn all AdSense ads on/off (on by default) and select which of the two main ad systems (AdSense or Chitika) should be considered the most important (default order is AdSense followed by Chitika).

These settings are under “Misc Ad Settings”.

The “Ad Post Number” sets which archive post that ad type should be shown on for the home page and archive pages (Categories, Tags, Search etc…). The ad network(s) set to “Post 1” will be shown within the first post of an archive page AND in the main content of Posts and Pages (top of the main content). By default AdSense is considered most important “Post 1”, the “AdSense Main Content Ad Unit” (by default a 336px x 280px Large Rectangle ad) will be shown in a high click through area of all pages.

AdSense Ad Placement

If you set more than one ad network to “Post 1” it will look messy, you can have them both as “Post 1”, but best to choose one of the main ad networks as the important one (I always keep it as AdSense as they tend to pay best). Ad networks set to “Post 2” and above will have their “Main Content Ad Unit” only shown on archive pages.

Google AdSense Search Form Widget Setup

Google AdSense for Search Stallion 6.1 added an experimental Google AdSense Search Form Widget which allows the use of a Search form that gives your visitors the option to search your site using the standard WordPress search feature or Google AdSense with your ads attached.

To integrate Google AdSense for Search as a sidebar widget create an “AdSense for Search” ad at your AdSense Control Panel and copy the RANDOMCHARACHTERS from the code that looks like this

<input type="hidden" name="cx" value="partner-pub-8325072546567078:RANDOMCHARACHTERS" />

On the Stallion AdSense Options page paste the RANDOMCHARACHTERS in the “AdSense For Search Integration” setting box.

Go to your Widgets menu and add the “9GAT Google AdSense Search”.

If you skip the RANDOMCHARACHTERS it will use my default settings (you will not recieve the ad revenue).

Optional AdSense Settings

WordPress AdSense Theme

For optional AdSense settings click the “AdSense Options” link on the left menu under the “Stallion Theme” menu. I realise these settings may appear a little daunting at first, but they are mostly self explanatory and very easy to use. On all Stallion options pages there’s a “Restore Default Settings” button at the bottom, if you make a mess or get lost with the settings, restore them to defaults (I do it all the time :-)).

At the top of the “AdSense Options” page there’s settings for AdSense ad colours, use the link to the “WebSafe Colour Codes” to select colours.

Below this is a section for each of the AdSense ad units, the first three are content ad units, the last three are link ad units.

Stallion AdSense Content Ad Unit

The “Main Content Ad Unit”, the settings are self explanatory as are the settings for the three link ad units.

The “Movable Content Ad Unit” is the fun one :-), this AdSense ad unit can be placed in 4 locations, some of which allow for a large 728px x 90px Leaderboard ad. Try them out with various ad sizes to see what works for your site.

The “Sidebar Content Ad Unit” is by default shown on the left sidebar, this can be changed by using the widgets menu : “Appearance” >> “Widgets”, drag and drop the “Stallion AdSense Content S1 Widget” to whichever sidebar you want it on – this is a multi-widget, can be added more than once, but remember you are only allowed 3 content ad units, add 4 or more and the ones loaded last code wise (normally the ad units on sidebars) will be blank spaces. If you wanted 3 sidebar ad units by adding this widget three times you must disable the other content ad units.

There’s a legacy copy of the “Stallion AdSense Content S1 Widget” called “XXStallion AdSense Content S1 Widget”, this is using old depreciated code and lacks multi-widget features like the “Widget Display Plugin” (feature turned on under “Stallion >> Layout Options” enable the “Widget Display Plugin”) doesn’t work with the old code. “XXStallion AdSense Content S1 Widget” uses the same AdSense settings, but lacks a heading that can be changed and has no multi-wdiget capabilities.

There are two additional settings for this ad unit related to it being on a sidebar, you can have this ad show or not show a heading “Advert” and show or not show a background that matches the colours of the theme (I tend to have no heading and no background colour set, looks better IMO).

Please take into account some ad unit sizes will not work in some locations, for example the 728px x 90px Leaderboard ad won’t fit if you select it for the “Main Content Ad Unit”.

AdSense Custom Ad Channels

To add a custom ad channel log into Google AdSense go to “AdSense Setup” >> “Channels”

If you already have Google AdSense channels copy the ID number from the “AdSense Setup” >> “Channels” page and paste it into the appropriate box on the admin page.

How to Hide AdSense ads on a Post by Post Basis

As of Stallion 7.1 there’s a new option on the Post and Page edit screens that turns main content AdSense ads for that blog post/static page on/off. This has no impact on sidebar AdSense ads, to disable sidebar AdSense ads under “Stallion >> Layout Options” enable the “Widget Display Plugin”, this adds new features to all multi-widgets (widgets that can be added more than once) including disabling widgets on specific posts/pages. There’s one multi-widget AdSense Content widget and one multi-widget AdSense links widget. If you are using the older AdSense widgets (labeled XX since Stallion 7.1) replace them with the new multi-widget version and use the new settings to disable on specific posts and pages.

Alternative Way to Hide AdSense Ads – Still Works

As of Stallion 6.1 the AdSense ads have a CSS class you can use to hide the ads. The ads are still loaded on the page, but your visitors won’t see them.

For posts and pages you wish to hide AdSense ads on do the following.

Edit the post or page, at the bottom of the edit form (where you add the main content) add one of the following. It’s best to add the code at the very bottom so it’s less likely to be loaded on archive pages, if a page is short of content the code might be used as part of the excerpt.

To hide all AdSense ads add:

<style>.stallionhideads, .stallionhidewads {display:none !important;}</style>

To hide the AdSense ads within the main content only (sidebar, header and footer ads will still be visible) add:

<style>.stallionhideads {display:none !important;}</style>

To hide the AdSense ads within the sidebar, header and footer areas (main content ads will still be visible) add:

<style>.stallionhidewads {display:none !important;}</style>

Do not use this code on posts where you have selected a Post Format (on the right menu of your edit screen: Aside, Audio, Chat etc…) where the format results in the entire content to be shown on archive pages. This would include the formats Aside, Audio, Chat, Image, Link, Quote, Status and Video. Standard and Gallery are safe. Using this code on one of the post formats above will load the code on archive pages like the home page and your ads will be hidden on the home page and other archives the post is loaded on.

Note: this code will hide AdSense, Chitika and Clickbank ads (works for them all).

David Law > AKA SEO Dave
*
: 20+ Years Experience as a Freelance SEO Consultant, WordPress SEO Expert, Internet Marketer, Developer of Multiple WordPress SEO Plugins/SEO Themes Including the Stallion Responsive Theme.

Website - SEO Gold