What should be done if there is warning
array_key_exists in your site after installing a theme package? Let’s continue to find the answer for this question.
Recently, many customers using our themes report us with this bug. That’s the reason why we want to write this quick tutorial to help you to successfully install the beautiful themes you want.
About the bug
After installing some theme package, when going into your site in the front end and even the back end, there is a notice at the top.
This is the warning notice in our test site after installing the Styleshop theme package:
Warning: array_key_exists() expects parameter 2 to be array, string given in /var/www.../wp-content/plugins/yith-woocommerce-wishlist/includes/class.yith-wcwl.php on line 1156
Which causes the bug
The question here is which causes the bug? Is it due to the theme? No, it’s totally not.
The reason here is resulted from the YITH WooCommerce Wishlist plugin.
It can’t be denied that this is a great and important plugin especially for ecommerce website. Then, it’s essential for us to fix and keep our site clean.
How to fix the bug
Actually, it’s not too difficult to fix this bug. You can do it! Just some simple step and no coding require!
Please follow the steps as below:
Step 1. Go to the Admin Panel of your site.
Step 2. Navigate to Settings > Permalinks to open the Permalink Settings.
Step 3. Change the default value of permanent link in Common Settings of the theme in your site into any other one.
Please note that it may not similar in different theme.
In Styleshop, the default is Plain, then you can change into any other option including Day and name, Month and name, Numeric or Custom Structure.
Extra Tip: How to check if a theme you use causes a bug
To make sure that the bug is due to the theme or not, you can try using default theme of WordPress and keeping all the plugin using in your site.
– If the bug remains, it’s not due to the theme you installed.
– If the bug disappears, it may be due to the theme, you should contact the theme developer to get support.
Hope that with this small tip, it will be easier for you to build a beautiful website as your expectation.
Thanks for reading!
WPTheme Go Team