diff --git a/functions.php b/functions.php index e83d7f6..f49f355 100644 --- a/functions.php +++ b/functions.php @@ -107,12 +107,15 @@ function render_event_jsonld_graph(array $events): string { foreach ($events as $e) { $start = $e['date'] . 'T' . ($e['time'] ?? '19:30') . ':00+02:00'; // Berlin Zeit im Sommer; vereinfacht $price = $e['price'] ?? ''; - $offers = $price !== '' ? [ + $validFrom = $e['created_at'] ?? $e['updated_at'] ?? null; + $offers = $price !== '' ? array_filter([ "@type" => "Offer", + "url" => event_url($e), "price" => preg_replace('/[^\d,\.]/', '', $price), "priceCurrency" => "EUR", - "availability" => "https://schema.org/InStock" - ] : null; + "availability" => "https://schema.org/InStock", + "validFrom" => $validFrom + ]) : null; $graph[] = array_filter([ "@type" => "Event", @@ -121,6 +124,10 @@ function render_event_jsonld_graph(array $events): string { "startDate" => $start, "eventStatus" => "https://schema.org/EventScheduled", "eventAttendanceMode" => "https://schema.org/OfflineEventAttendanceMode", + "performer" => !empty($e['speaker']) ? [ + "@type" => "Person", + "name" => $e['speaker'] + ] : null, "location" => [ "@type" => "Place", "name" => $e['venue_name'] ?? "Veranstaltungsort",