Well, % is a modulus operator, but $xyz is a class name…so I’m not sure why the modulus operator is there, that wants a math function…try removing it (the %2 or %3)
is something broken in theme, or is it just a warning…be careful changing stuff if everything works good…you can turn off debug and you won’t see them. https://codex.ww.wp.xz.cn/WP_DEBUG
or are you just reporting a bug? If that’s the case, ignore my post…(but they should have another place for that really I think)
Debugging is not enabled my WP installation – this is showing up in the error_log — not impairing site function.
However, this is an issue that should be addressed. PHP 7.1 was released in December 2016. I’m running more than a dozen WP sites with different plugin and themes, and I tested them all with PHP 7.1 in February and reported errors then.
Evolve is the only theme remaining (among the ones I use) that has not yet addressed this issue.
The bottom line is that the code does not validate under current (latest) standards, because of changes introduced in PHP. It’s not the fault of the developer that changes to PHP weren’t anticipated when the file was coded, but it is important to maintain compatibility down the line — so that is why I am reporting it.
Thank you for the suggestion about removing the modulus operator. I’m reluctant to make changes to a theme lest I introduce other errors, but I’ll test to see if that seem to resolve the problem and post back here if it does.
Donna, thank you for your suggestion — I did change line 1430 from:
echo ' col-md-4 odd' . ( $xyz % 3 );
to
echo ' col-md-4 odd' . ( $xyz );
And I haven’t seen any more entries in my error log since making the change.
I’m not sure what that bit of code was intended to do, but everything on my site appears to be functioning and displaying properly.
I did intend this post to be a bug report (or at least a possible compatibility issue with PHP 7.1) — so I’m leaving this marked as “not resolved” — the developer can review this and determine whether or not it is something that should be addressed. (My problem is that I assume that anything placed in code was intentional and placed for a reason, so just because it works for me to delete a few characters doesn’t really mean that the problem has been addressed.)
But I definitely do appreciate your input — as it saves me the trouble of having to revert the site back to PHP 7.0.
Sure, I understand.
The reason it works is because of how a modulus operator works. A modulus operator says “take a number, divide by another number, and whatever the remainder is, this is your answer”
For example : 7 modulus 3 is 1. Because 7 divided 3 is 2 with a remainder of 1. This is how the modulus operator works. In your code $xyx is a string or character variable, not a number. ( I don’t remember now, doing post from my phone)
Hopefully that explains why.
Thank you for your very clear explanation — I also appreciate the mini-lesson ion coding. I’m still puzzled by why it was coded that way in the first place.
The file is commented:
/*
* function to print out css class according to layout
* used in content-blog.php, index.php.
so I am guessing that the goal is simply to generate a stylesheet which adapts to values users have entered in theme customizations… and apparently it isn’t working anyway. At least for me I haven’t noticed any issues with layout after modifying the script, but if it did crop up I have a child theme and could correct any issues by manually editing my child stylesheet.
So I’ll let the developers figure out the rest.
It looks like it has something to do with columns…
-
This reply was modified 9 years, 2 months ago by
donnaWPadmin.
Hello
This issue solve in next theme update, In many files this change required.
Only issue generate with 7.1.X version now.
Thank you