Skip to content

Instantly share code, notes, and snippets.

@zhonmaz
Created November 8, 2019 04:13
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 zhonmaz/f41934b29760cda18a6b2905b2c698ab to your computer and use it in GitHub Desktop.
Save zhonmaz/f41934b29760cda18a6b2905b2c698ab to your computer and use it in GitHub Desktop.
/* ----------------------------------------------------------------------------
Type the name of the ad unit here
*/
add_shortcode( ' your_shortcode_name ', 'your_shortcode_function_name' );
function your_shortcode_function_name () {
if( aicp_can_see_ads() ) { // This part will show ads to your non-banned visitors
$adCode = '<div class="aicp">
Dán mã quảng cáo Adsense vô đây !
</div><!-- end of the aicp div -->';
return $adCode;
} else { // Anything within this part will be shown to your banned visitors or to the blocked country visitors
return '<div class="error">You have been blocked from seeing ads.</div>';
}}
/* ----------------------------------------------------------------------------
End of code
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment