Adsense Options

From Graphene Theme Documentation
Jump to: navigation, search
The placement of Adsense ads under the post

This options group is provided so that you can insert Google Adsense ads unit after each posts or pages. If you want to put the ads somewhere else, use the Text Widgets instead in WP Admin > Appearance > Widgets. You may need to manually write the CSS codes for the ads style and placement.

Options list

Show Adsense advertising
Outputs the Adsense codes into the page
Show ads on front page as well
By default, the theme does not display the ads on the front page. Enable this option if you would like ads to be displayed on the front page as well.
Your Adsense code
Insert your Adsense codes into this field. You must enter the full code, which usually look something like this:
<script type="text/javascript"><!--
google_ad_client = "ca-pub-################";
/* ad unit title */
google_ad_slot = "##########";
google_ad_width = 468;
google_ad_height = 60;
<script type="text/javascript" src=""></script>

Ads limit & premium publisher

Adsense ads entered using the theme's options page will only be shown a maximum of 3 ads per page. This is the limitation set by Google for non-premium publishers (which is most of us). Placing more Adsense ads codes in the page will result in a blank area being shown for those ads, and may affect your standing in Adsense. Therefore, it is better to not place any more than 3 Adsense ads per page, which is what the theme is doing.

If you are a premium Adsense publisher, and would like to alter the maximum number of ads to be shown per page, follow these steps:

  1. Create a child theme
  2. Create a functions.php file in your child theme.
  3. Insert this code into your child theme's functions.php file:
function graphene_custom_ads_limit(){
   return 10;
add_filter( 'graphene_adsense_ads_limit', 'graphene_custom_ads_limit' );
You can replace the number 10 in the code above with the desired number of Adsense ads per page you'd like.