Today I Tell You How To Make Your Blog As a IP Detection Blog/Website. In This Way Your All Visitors Will See Their IP Address In Your Blog.
Please Copy The Below Code And Paste In Your Theme function.php File.
// 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');
Next Is Please Put The Below Shortcode In Your Post, Page OR Sidebar Widget Where You Want To Show Your Visitors IP Address.
If You Are Use The Shortcode In Sidebar Widget And You Are Not See Any IP Address. Then Please Make Sure That You Are Enable Shortcode For Your Sidebar Widget.
Must Read: How To Create Password Protected Post In WordPress
Please Enable Your Sidebar Widget For Shortcodes By Paste The Below Code In Your Theme function.php
add_filter('widget_text', 'do_shortcode');
It’s very sіmple to find out any topic on web as compared to books, aas
I found tɦis post at this web page.