This goes into the php everywhere code box:
<?php
if($instance==”1″)
{…}
if($instance==”2″)
{…}
?>
This goes into the page’s html:
[php_everywhere instance=1]
[php_everywhere instance=2]
Works for me like that.
Not sure about using “else”
Make sure you close php tag.
That’s the original construct I used… upon saving the WP page, it threw an error; every attempt to access that page resulted in WP crashing.
FYI, the IF statements in the php_everywhere box were simple INCLUDE statements.
Would be better if you shared your code.
When did you get the error? was it working before?
A few possible pointers:
Check php 7.4 changelog and compare with your code. Maybe a legacy command is the culprit.
Check the console and see if there are any errors in there.
Try debugging by simplifying and running your code one chunk at a time and see at what stage it throws an error.
Here’s the error:
Updating failed. The response is not a valid JSON response.
I suspect Gutenberg editor.
Try switching back to classic editor.
I am using “Disable Gutenberg plugin”.