We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Noticing this error on a WP install (fully updated) with latest Pages theme:
PHP Warning: Attempt to read property "post_parent" on null in <path-to-root>/wp-content/themes/pages/functions.php on line 163
The text was updated successfully, but these errors were encountered:
I don't see the warning (probably because we're on different versions of PHP), but I do believe I fixed it.
Before I push the update live for everyone are you comfortable testing the fix to see if it clears all warnings?
If so, update lines 160-165 of functions.php to:
if ( isset( $post->post_parent ) ? $post->post_parent : 0 ) { echo '<li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"><a href="' . esc_url( get_permalink( $post->post_parent ) ) . '" itemprop="item"><span itemprop="name">' . esc_attr( get_the_title( $post->post_parent ) ) . '</span></a><meta itemprop="position" content="2" /></li>'; } if ( is_single() || !empty( $post->post_parent ) ) { echo ' <span aria-hidden="true">→</span> '; }
Sorry, something went wrong.
No branches or pull requests
Noticing this error on a WP install (fully updated) with latest Pages theme:
PHP Warning: Attempt to read property "post_parent" on null in <path-to-root>/wp-content/themes/pages/functions.php on line 163
The text was updated successfully, but these errors were encountered: