dimanche 4 octobre 2015

Google maps custom plugin not working

I ve written a custom google map plugin but there is something wrong with the php. The map does not display. I have done some research but I cannot seem to understand what is missing. Here is the code for the php file. It should read the contents of an html file that contains the API code for google maps. The problem is, it does not display anything.

<?php

/*
* Plugin Name: Google maps search
* Description: Search box on google maps
* Version: 0.1
* Author: 
* Author URI:  */

function s(){
$fd = fopen("map.html", r);
$content = fread($fd, filesize("map.html"));
fclose($fd);

echo $content;
}

add_shortcode('map','s');
?>



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire