Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (!in_array(get_the_user_ip(), array( '127.0.0.2', '127.0.0.0' ) )) {
- ?>
- código adsense
- <?php
- }
- ?>
- añadir al functions.php de tu theme, al final del todo:
- function get_the_user_ip() {
- if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {
- $ip = $_SERVER['HTTP_CLIENT_IP'];
- } elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
- $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
- } else {
- $ip = $_SERVER['REMOTE_ADDR'];
- }
- return apply_filters( 'wpb_get_ip', $ip );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement