PHP Notices appear when browsing any page in admin, but only for child theme, using code from WP Codex

That’s pretty simple:

You’re trying to get the parent property from the $post object, but that is either NULL or simply not attached. In both cases, you are

Trying to get property of non-object

from the $post object.

Simply check if ( isset( $post->parent ) ) { /* do stuff */ }.