Nach dem Wechsel zum Storefront-Thema ist die Leaflet-Map verschwunden. Link how it looksLeaflet-Map wird nicht auf der Wordpress-Seite angezeigt
functions.php
add_action('wp_enqueue_scripts', 'enqueue_parent_theme_style');
function enqueue_parent_theme_style() {
wp_enqueue_style('parent-style', get_template_directory_uri().'/style.css');
/* wp_enqueue_style('bootstrap', 'http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'); */
wp_enqueue_style('leaflet.css','http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css');
}
function theme_scripts(){
wp_enqueue_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js', array('jquery'), '1.12.2', false);
wp_enqueue_script('bootstrap-js', 'http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js', array('jquery'), false);
wp_enqueue_script('leaflet.js', 'http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js' ,false);
wp_enqueue_script('main.js', get_template_directory_uri(). '/js/main.js');
}
add_action('wp_enqueue_scripts', 'theme_scripts');
Bootstrap kommentiert, weil es Website-Ansicht bricht (es wird kleiner). Aber ohne Kommentar funktioniert die Karte trotzdem nicht.
Ich habe einen Link zur Kartenseite hinzugefügt. Ich weiß nicht, ob es richtig ist.
<link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_directory_uri() ; ?>/css/bootstrap.min.css">
<script type="text/javascript" src="<?php echo get_stylesheet_directory_uri() ; ?>/js/main.js"></script>
danken Ihnen für Beratung! Es funktioniert. – Dima