Is it possible to place code in the 404.php file which will change elements in the header.php file?
For example, if a 404.php page is loaded, I want the page's title and description to be filled in with specific values.
However, as it is these values are empty.
Yes, like objects said:
An example of your header.php:
<html>
<head>
<title><?php if(is_home()) { echo "Home"; } elseif(is_404()) { echo "Error!"; } elseif(is_page()) { echo "Page"; } elseif(is_single()) { echo "single"; } else { "Anything else"; } ?></title>
</head>
<body>
WordPress Hooks are very easy to use
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With