Skip to content

Instantly share code, notes, and snippets.

@dartiss
Last active March 8, 2018 09:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dartiss/0e1dc4b2ba935266fd8fd9f96a51850c to your computer and use it in GitHub Desktop.
Save dartiss/0e1dc4b2ba935266fd8fd9f96a51850c to your computer and use it in GitHub Desktop.
Adding AdSense Auto ads to your WordPress site
function google_autoads() {
?>
[[insert your AdSense script here]]
<?php
}
add_action( 'wp_head', 'google_autoads' );
@dartiss
Copy link
Author

dartiss commented Mar 8, 2018

To add the AdSense Auto ads to your site, simply add this script to your theme's function.php file, inserting the JavaScript code that Google Adsense provides you where it says [[insert your AdSense script here]].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment