Last active
August 29, 2015 13:57
-
-
Save ximosa/9781006 to your computer and use it in GitHub Desktop.
Añadir adsense con Shortcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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