Home › Forum › Plugin e temi di WP › mappe google in sidebar diverse
-
AutorePost
-
-
21 Marzo 2009 alle 1:39 #9873lorymacriPartecipante
Ciao ragazzi, ho necessità per 3 sidebar diverse di caricare tre mappe diverse. Senza usare nessun plugin come posso fare? ho provato una cosa del genere ma non funziona:
Se faccio un test su una pagina web funziona, se la metto in wordpress no
header.php
<script type="text/javascript">
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
map.setUIToDefault();
}
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas2"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
map.setUIToDefault();
}
}
</script>
<body onload="initialize()" onunload="GUnload()">
Sidebar1
<div id="map_canvas" style="width: 500px; height: 300px"></div>
Sidebar2
<div id="map_canvas2" style="width: 500px; height: 300px"></div>
-
21 Marzo 2009 alle 7:57 #63994webnicolaPartecipante
Mmmhhh di preciso cosa non funziona?
header.php potrebbe andare, poi come e dove chiami le diverse sidebar?
Qualche altro aiuto per aiutarti?
-
21 Marzo 2009 alle 13:18 #64001lorymacriPartecipante
Mmmhhh di preciso cosa non funziona?
header.php potrebbe andare, poi come e dove chiami le diverse sidebar?
Qualche altro aiuto per aiutarti?
Ciao Webnicola,
allora uso ho 3 pagine di categoria (category-X)in wordpress e ognuna ha una sidebar diversa, la prima sidebar, quella che chiama il primo if
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
map.setUIToDefault();
}
funziona, carica la mappa... le altre no
la sidebar la inserisco cosi:
<?php
/*
Template Name: category-66
*/
?>
<?php get_header(); ?>
<div id="content">
<div id="homepage">
aosta
</div>
<?php include(TEMPLATEPATH."/sidebar_valledaosta.php");?>
</div>
<!-- The main column ends -->
<?php get_footer(); ?>
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.