~ Display Visitors IP On your WordPress Page ~

So you Want to display your Visitors IP on Any Page of your website.

Well you have come to the right place.  Here I will outline some steps to take to Display your Visitors IP to them..

Now.. Lets Begin

All you have to do is paste the following snippet in your theme’s functions.php file or in a site-specific Plug-In.

~Begin~

// Display User IP in WordPress
 
 
 function get_the_user_ip() {
 if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {
 //check ip from share internet
 $ip = $_SERVER['HTTP_CLIENT_IP'];
 } elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
 //to check ip is pass from proxy
 $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
 } else {
 $ip = $_SERVER['REMOTE_ADDR'];
 }
 return apply_filters( 'wpb_get_ip', $ip );
 }
 
 add_shortcode('show_ip', 'get_the_user_ip');

~End~

Next thing you need to do is add the following shortcode in your post, page, or in a sidebar widget.

[‘show_ip’]^^ Remove the’