Calculate distance between 2 address using latitude and longitude

To calculate the distance between two locations using their latitude and longitude coordinates, you can use the Haversine formula. The Haversine formula is commonly used to calculate the great-circle distance between two points on the surface of a sphere (such as the Earth) given their latitude and longitude.

Jquery Form Validator With User Name Exist User Email Exist

To implement jQuery Form Validator with the specified validation rules, including required, minlength, email, equalTo, custom validation, confirm password, username pattern, email existence in the database in WordPress, and username with no numeric value, you’ll need to combine client-side validation using jQuery Form Validator with server-side validation using PHP and WordPress functions.

Adding Sidebar In WordPress Theme

Adding a sidebar to a WordPress theme involves modifying the theme files and registering a new sidebar area using WordPress functions. Below are the general steps to add a sidebar in WordPress themes:

How To Limit Search To Only Post Titles?

I added a text field to the posts filter form and I use s= parameter to make the search work. But how to search only in the title of the post (not in the content)? how to limit search to post titles? How to search only by Post Title?

How To Add Sub Menu In WordPress Admin Panel

How to add sub-menu in WordPress admin panel – In this post we see how we can add custom sub-menu to admin sidebar. Sometimes when we on WordPress and we need to show some features or any information in admin page then we can use this code snippet to create the same.

How To Get the client IP address using PHP

To get the client’s IP address using PHP, you can use the `$_SERVER` superglobal variable. Here’s an example of how you can retrieve the client’s IP address: // Get the client IP address $client_ip = $_SERVER[‘REMOTE_ADDR’]; // Display the client IP address echo ‘Client IP Address: ‘ . $client_ip;   In this example, `$_SERVER[‘REMOTE_ADDR’]` retrieves the IP address of the client making the request to your PHP script. Please note that the `REMOTE_ADDR` value in the `$_SERVER` superglobal may not always provide the actual client IP address. In some cases, if your server is behind a proxy or load balancer, it may return the IP address of the proxy or load balancer. To handle such cases, you can consider using other headers like `HTTP_X_FORWARDED_FOR` or `HTTP_CLIENT_IP` to get the correct client IP address. Here’s an example that shows how to check for forwarded IP headers:   // Get the client

How To Add Menu In WordPress Admin Panel

How to add menu in WordPress admin panel – In this post we see how we can add custom menu to admin sidebar. Sometimes when we on WordPress and we need to show some features or any information in admin page then we can use this code snippet to create the same.

How To Customize/Replace WordPress Post Excerpts

Example: Sometime we need to show content on frontend with adding some prefix or suffix or may be you have enter spelling mistakes in 2000 posts. so it is very difficult to modify 2000 posts so we can modify using filter . SO mistake will be replaced by correction.   For Modifying post content only:   function link_words( $text ) { $replace = ‘Replace with’; $text = str_replace( ‘Want To replace text’, $replace, $text ); return $text; } add_filter( ‘the_content’, ‘link_words’ );   For Modifying post excerpt only   function link_words( $text ) { $replace = ‘Replace with’; $text = str_replace( ‘Want To replace text’, $replace, $text ); return $text; } add_filter( ‘the_excerpt’, ‘link_words’ );   For Modifying post content and excerpt both   function link_words( $text ) { $replace = ‘Replace with’; $text = str_replace( ‘Want To replace text’, $replace, $text ); return $text; } add_filter( ‘the_content’, ‘link_words’ );

Categories