Front End Posting with WordPress


In this tutorial I am going to discuss how to insert posts via the front end of a WordPress blog. This tutorial will also cover some validation techniques, setting the post as “pending”, and email notification when a new post is created. So let’s begin!

First, you would want to create a new page, let’s call it “Add Article” with a slug of “add-article”. Make sure that your permalink settings it set to “/%postname%/”

Create a PHP file: page-add-article.php. Test this page, it should show a blank white screen.
Continue Reading…

How to get distance between two places using Google Maps


Are you looking for getting distance between two places using google map, just use the below php code for action.

Use curl to use google map api to get the distance.
Here the format of address
$address = $value[“street”].” “.$value[“region”].” “.$value[“country_id”].” “.$value[“zip_code”];

Now just paste the code

$url = “”.str_replace(‘ ‘, ‘+’, $source_address).”&destination=”.str_replace(‘ ‘, ‘+’, $destination_address).”&sensor=false”;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXYPORT, 3128);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
$response_all = json_decode($response);
// print_r($response);
$distance = $response_all->routes[0]->legs[0]->distance->text;