Created
October 2, 2020 19:43
-
-
Save ideadude/028266c33c30d806d0453e7a6018f782 to your computer and use it in GitHub Desktop.
Some examples of showing AdSense code for certain members only.
This file contains hidden or 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
<?php | |
// show ads to non-members and level 3 | |
if( pmpro_hasMembershipLevel( array(0,3) ) ) { | |
?> | |
<script>//...</script> | |
<?php | |
} | |
// use the pmpro_displayAds function | |
// https://www.paidmembershipspro.com/documentation/content-controls/hide-ads/ | |
if ( function_exists( 'pmpro_displayAds' ) && pmpro_displayAds() ) { | |
?> | |
<script>//...</script> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment