From 6abbf11a85e0a05584bb4f972f14ff3f7d0536e5 Mon Sep 17 00:00:00 2001 From: Philipp <32090713+ouun@users.noreply.github.com> Date: Thu, 20 Apr 2023 17:01:14 +0200 Subject: [PATCH] Prevent Breadcrumbs on 404 This fixes the PHP error `Undefined array key 404`. Thought about adding a specific key for that case, but as the content is not found it is obsolete IMO. --- src/Crumb.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Crumb.php b/src/Crumb.php index fd5224c..be5f57e 100644 --- a/src/Crumb.php +++ b/src/Crumb.php @@ -63,7 +63,7 @@ protected function add($key, $value = null, $blog = false) */ public function build() { - if (is_front_page()) { + if (is_front_page() || is_404()) { return $this->breadcrumb; }