Closed sandrodz closed 7 years ago
Please add a better description to your issue with the code which fails (functions.php:68
). Just pasting error messages on GitHub issues will make it hard for maintainers to help you.
oops. sorry.
Its seem the $post
object doesn't exist in the 404 page. Could you try to dd()
the $post
object in the 404.php
file in your theme?
I cannot dd inside 404.php as fatal error happens in functions.php file before theme file gets executed.
but yes $post
is null
Okay, we'll have to do some debugging on this. If you find a solution, please let us know!
@sandrodz are you using any more plugins or something that interfere with the wp_title? I am using the latest version of WordPlate and I don't get this error.
@puredazzle this is my composer.json I use cmb2 and polylang, later one does some magic to wp_title, but why does this happen only on 404?
{
"name": "wordplate/wordplate",
"description": "A modern WordPress stack. Don't repeat yourself.",
"keywords": ["wordplate", "wordpress", "boilerplate", "plate"],
"license": "MIT",
"require": {
"php": "^7.0",
"wordplate/framework": "^5.1",
"wordplate/plate": "^2.3",
"johnpbloch/wordpress": "4.7.4",
"wordplate/autoloader": "^0.1.2",
"pug-php/pug": "^2.5",
"wpackagist-plugin/cmb2": "^2.2",
"wpackagist-plugin/polylang": "^2.1"
},
"repositories": [
{
"type": "composer",
"url": "https://wpackagist.org"
}
],
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
]
},
"config": {
"preferred-install": "dist"
},
"extra": {
"installer-paths": {
"public/mu-plugins/{$name}": [
"type:wordpress-muplugin",
"wordplate/plate",
"wpackagist-plugin/cmb2",
"wpackagist-plugin/polylang"
],
"public/plugins/{$name}": ["type:wordpress-plugin"],
"public/themes/{$name}": ["type:wordpress-theme"]
},
"wordpress-install-dir": "public/wordpress"
}
}
@sandrodz it seems that this is not being used any more by WordPress so we will remove the function all together, please see https://github.com/wordplate/wordplate/pull/177
The wp_title
is deprecated and we've removed it from WordPlate, please see #177.
Thank you, works great.