Have you tried:
– deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).
– switching to the default theme to rule out any theme-specific problems.
– resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.
– re-uploading all files & folders – except the wp-content folder – from a fresh download of WordPress. Make sure that you delete the old copies of files & folder before uploading the new ones.
I solved it by replacing the codes in the post.php file in wp-includes folder:
Old:
function get_page_uri($page) {
$page = get_post( $page );
$uri = $page->post_name;
foreach ( $page->ancestors as $parent ) {
$uri = get_post( $parent )->post_name . “/” . $uri;
}
return $uri;
}
New:
function get_page_uri($page) {
if ( ! is_object($page) )
$page = get_post( $page );
$uri = $page->post_name;
/* Added (array) in the offending line below */
foreach ( (array)$page->ancestors as $parent ) {
$uri = get_post( $parent )->post_name . “/” . $uri;
}
return $uri;
}
This might work for you as well 🙂
I’d advise against modifying WordPress core files. When you update next time your change will be lost.
As the topic you link to showed: most people found that a plugin was causing this error.
You would be better off (and more secure) to fix the real cause of the error.