Skip to content

Instantly share code, notes, and snippets.

@cleberoliveira
Last active February 16, 2017 13:30
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 cleberoliveira/ccaf6e36e278565cbcbff62ac619d40a to your computer and use it in GitHub Desktop.
Save cleberoliveira/ccaf6e36e278565cbcbff62ac619d40a to your computer and use it in GitHub Desktop.
Simples WordPress plugin que adiciona código Google AdSense no header.
<?php
/*
Plugin Name: Meu Código AdSense
Description: Ativa meu código adsense no site.
*/
function meu_cod_adsense() { ?>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-1518857307023639",
enable_page_level_ads: true
});
</script>
<?php }
add_action( 'wp_head', 'meu_cod_adsense', 10 );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment