I received this error whilst testing on my WordPress website, (after upgrading from Bootstrap 4 to Bootstrap 5).
Warning: Undefined array key 0 in D:\websites\XAMPP\htdocs\mergie.com\wp-content\themes\your-theme?\your-file.php? on line 33

Turns out it was because my variables were before my ‘if’ statement.
Before:

By simply moving the variables below the ‘if’ statement fixed the issue…
After:

I found the detail of how to fix using Google Search…
Hope this helps… ![]()