Theme Update Creates Visible Code on Frontend

Hello,

With the last 3-4 updates, there is a specific line of code that is visible on the front facing site and in the admin back end.

Notice: Undefined index: WP_Widget_Recent_Comments in /home/BLAH/public_html/prime/wp-content/themes/x/framework/functions/setup.php on line 213

Each time I find the problematic lines of code in the parent theme (it is regarding comments which I have removed completely from the site) and remove it. But how would I revise the child theme so I don’t have to do this each and every time?

Please advise. Thanks.

Hi Cinn,

What you are getting is just a notice and should not stop any feature of the site from working. If you disable WP_DEBUG in the wp-config.php file, the warning message should not show up.

Hope this helps.

Thank you for clarifying this issue for me Jade.

Is there a way to disable this one notice or will disabling the WP_DEBUG in wp-config.php affect all notices? I prefer the former.

Hi Cinn,

Basically this will stop displaying any PHP warning, notice or an error message on the front-end of your website. Since it’s a PHP notice you can ignore it by disabling WP_DEBUG mode on your WordPress.

Also could you please check the PHP version running on your server and make sure to use PHP v5.6.x or later to avoid any incompatibility issues. If you’re already using a PHP version within that range, try switching to a different version and see if that resolves your issue.

Thanks!

Hey mldarshana,

My server seems to be running PHP version: 7.2.7.

Can you advise on how I would disable WP_DEBUG mode?

Thanks!

Hi There,

Please take a look at this article:

Hope it helps :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.