To create the map and mapper as written by kodee

document.addEventListener(‘DOMContentLoaded’, function () { const map = L.map(‘treasure-map’).setView([51.5033, -0.1196], 12); L.tileLayer(‘https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png’, { attribution: ‘© OpenStreetMap contributors’ }).addTo(map); const items = document.querySelectorAll(‘.treasure-item’); const markers = []; items.forEach(function (item) { const lat = Number(item.dataset.lat); const lng = Number(item.dataset.lng); if (!Number.isFinite(lat) || !Number.isFinite(lng))…Continue reading

zooming to user’s location

document.addEventListener(‘DOMContentLoaded’, function() { // 1. Find all images within the WPForms View const itemImages = document.querySelectorAll(‘.wpforms-view-entry img’); itemImages.forEach(img => { img.style.cursor = ‘pointer’; // Make it look clickable img.addEventListener(‘click’, function() { // 2. Find the postcode text near the map…Continue reading

Add Security Headers

function add_security_headers() { header(“Strict-Transport-Security: max-age=31536000; includeSubDomains; preload”); // header(“Content-Security-Policy: default-src ‘self’; img-src ‘self’ data: https:; script-src ‘self’ ‘unsafe-inline’ https:; style-src ‘self’ ‘unsafe-inline’ https:; frame-ancestors ‘self’”); header(“X-Frame-Options: SAMEORIGIN”); header(“X-Content-Type-Options: nosniff”); header(“X-XSS-Protection: 1; mode=block”); header(“Referrer-Policy: strict-origin-when-cross-origin”); header(“Permissions-Policy: camera=(), microphone=(), geolocation=()”); } add_action(‘send_headers’,…Continue reading

Untitled Snippet

[randomimage path=”wp-content/dailydiary/uploads/goodmorning/” alt=” Good Morning”]   [randomimage path=”wp-content/dailydiary/uploads/goodnight/” alt=” Good Morning”]Continue reading