/* Theme Name: Astra Child - Patti di Collaborazione Description: Child theme per Patti di Collaborazione Senigallia Template: astra Version: 1.0.0 Author: Comune di Senigallia - Area 11 Text Domain: astra-child-patti */ // Enqueue parent styles add_action( 'wp_enqueue_scripts', function() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_uri(), array( 'parent-style' ) ); } ); // Add theme support per CPT templates add_action( 'after_setup_theme', function() { add_theme_support( 'post-thumbnails' ); } ); // Leaflet per single patto (mappa localizzazione) - usa file JS separato add_action( 'wp_enqueue_scripts', function() { // Non eseguire durante richieste REST API, AJAX, admin o cron if ( wp_doing_ajax() || wp_is_json_request() || defined( 'REST_REQUEST' ) || defined( 'WP_CLI' ) ) { return; } if ( is_singular( 'patto_collaborazione' ) ) { $lat = get_field( 'patto_latitudine' ); $lng = get_field( 'patto_longitudine' ); if ( $lat && $lng ) { wp_enqueue_style( 'leaflet-css', 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.css', array(), '1.9.4' ); wp_enqueue_script( 'leaflet-js', 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.js', array(), '1.9.4', true ); wp_enqueue_script( 'patto-single-map', get_stylesheet_directory_uri() . '/assets/js/single-map.js', array( 'leaflet-js' ), '1.0.0', true ); wp_localize_script( 'patto-single-map', 'pattoSingleMap', array( 'lat' => floatval( $lat ), 'lng' => floatval( $lng ), 'title' => get_the_title(), ) ); } } } ); Proponi un Patto di Collaborazione - OpenProject Italia

Proponi un Patto di Collaborazione

Dati del Proponente
Dettagli della Proposta
Allegati (opzionali)
Massimo 5 file, 10MB cada
Torna in alto