SHARE
TWEET

adsense ip

a guest Sep 21st, 2018 30 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. if (!in_array(get_the_user_ip(), array( '127.0.0.2', '127.0.0.0' ) )) {
  3. ?>
  4. código adsense
  5. <?php
  6. }
  7. ?>
  8.  
  9. añadir al functions.php de tu theme, al final del todo:
  10.  
  11. function get_the_user_ip() {
  12. if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {
  13. $ip = $_SERVER['HTTP_CLIENT_IP'];
  14. } elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
  15. $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
  16. } else {
  17. $ip = $_SERVER['REMOTE_ADDR'];
  18. }
  19. return apply_filters( 'wpb_get_ip', $ip );
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top