0

My self-created theme no longer works under PHP 8. I would like to change it so that it continues to work. Currently only the navigation is displayed.

I have deactivated all plugins.

I have tried to solve this via the help page, but I can't find the error(s).

I have provided the theme as a ZIP.

I would be grateful for any help.

The page I need help with: https://www.johanneskroening.de/

1
  • 1
    I see that you found the answer. But your error.log file should be the first place you look. (This is for future lurkers.) Turning on DEBUG in the wp-config.php file will also help. Nov 19 at 22:13

1 Answer 1

0

I have found the error.

In the header.php an undefined constant was tried to be accessed. So instead of the following wrong code:

<?php if ($pagetitle == pagetitle_1){

  $pt1 = "pagetitle_1";

  $main = "main_1";

} else {

  $pt1 = "";

}

?>

I had to add the quotation marks to pagetitle:

<?php if ($pagetitle == "pagetitle_1"){

  $pt1 = "pagetitle_1";

  $main = "main_1";

} else {

  $pt1 = "";

}

?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.