Skip to content

Instantly share code, notes, and snippets.

@ximosa
Last active August 29, 2015 13:57
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 ximosa/9781006 to your computer and use it in GitHub Desktop.
Save ximosa/9781006 to your computer and use it in GitHub Desktop.
Añadir adsense con Shortcode
//Personalizamos la funcion con nuestro código adsense
function get_adsense($atts) {
return '<script type="text/javascript"><!--
google_ad_client = "pub-su numero de adsense";
/* 468x60, created 9/13/10 */
google_ad_slot = "su numero de adsense/";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
';
}
//Añadimos el shortcode para insertar en los post de esta forma [adsense]
add_shortcode('adsense', 'get_adsense');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment