Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?
Closed 4 years ago.
Improve this questionI found this error but not sure what should I do, I already disabled the plugins and activated them again but same error shows in the reviews page of each product.
Gladly appreciate your help
Here's the exact error:
Warning : Invalid argument supplied for foreach() in /home/blossomt/public_html/wp-content/themes/rubens/template/single-product/_review.php
on line 56
So I went to my theme editor and here's what I see on line 56, but not sure if I should touch this code, I'm not a coder:
printf('<div class="rate"><div class="starscont">%s </div></div>',
Closed. This question is off-topic. It is not currently accepting answers.
Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?
Closed 4 years ago.
Improve this questionI found this error but not sure what should I do, I already disabled the plugins and activated them again but same error shows in the reviews page of each product.
Gladly appreciate your help
Here's the exact error:
Warning : Invalid argument supplied for foreach() in /home/blossomt/public_html/wp-content/themes/rubens/template/single-product/_review.php
on line 56
So I went to my theme editor and here's what I see on line 56, but not sure if I should touch this code, I'm not a coder:
printf('<div class="rate"><div class="starscont">%s </div></div>',
Share
Improve this question
edited Jan 22, 2021 at 9:05
fuxia♦
107k38 gold badges255 silver badges459 bronze badges
asked Jan 21, 2021 at 23:08
JoseJose
1
1
- So this is the comment about this error inside the theme editor: printf('<div class="rate"><div class="starscont">%s </div></div>', – Jose Commented Jan 21, 2021 at 23:23
1 Answer
Reset to default 1What you are seeing is a warning, not an error. The code that you posted does not look like foreach at all, if you can paste the code that has a foreach close to that line, we might be able to help.
If you did not write the theme, don't try and fix it unless you know what you are trying to do.
Write the following in your wp-config.php file:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
(change WP_DEBUG to false if you are in production)
That warning won't show up any longer. Look inside wp-content for a file called debug.log and examine the errors there. If functionality is not affected, I would simply ignore this before changing the code of something you are not familiar with.