Posted on by
prepare('SELECT * FROM posts WHERE slug = ?'); $stmt->execute([$slug]); $post = $stmt->fetch(PDO::FETCH_ASSOC); } catch (PDOException $e) { error_log('Failed to fetch post: ' . $e->getMessage()); } } if (!$post) { http_response_code(404); require_once __DIR__ . '/includes/header.php'; echo '
'; require_once __DIR__ . '/includes/footer.php'; exit; } // SEO & Page Variables $pageTitle = $post['seo_title'] ?? $post['title']; $pageDescription = $post['seo_meta_description'] ?? substr(strip_tags($post['content']), 0, 160); $og_image = $post['image_url']; // Assuming this is a full URL $og_type = 'article'; require_once __DIR__ . '/includes/header.php'; ?>