Trying to get property of non-object
-
I am having trouble with the plugin when I activate and set it up. The following text pops up above my slider section, also causing other large sections of blank space on various pages.
“Notice: Trying to get property of non-object in /home/theraved/public_html/wp-includes/class-wp-query.php on line 3760
Notice: Trying to get property of non-object in /home/theraved/public_html/wp-includes/class-wp-query.php on line 3762
Notice: Trying to get property of non-object in /home/theraved/public_html/wp-includes/class-wp-query.php on line 3764
Notice: Trying to get property of non-object in /home/theraved/public_html/wp-includes/class-wp-query.php on line 3760
Notice: Trying to get property of non-object in /home/theraved/public_html/wp-includes/class-wp-query.php on line 3762
Notice: Trying to get property of non-object in /home/theraved/public_html/wp-includes/class-wp-query.php on line 3764”
Here is the referenced code in the .php file
public function is_page( $page = '' ) { if ( !$this->is_page ) return false; if ( empty( $page ) ) return true; $page_obj = $this->get_queried_object(); $page = array_map( 'strval', (array) $page ); if ( in_array( (string) $page_obj->ID, $page ) ) { return true; } elseif ( in_array( $page_obj->post_title, $page ) ) { return true; } elseif ( in_array( $page_obj->post_name, $page ) ) { return true; } else { foreach ( $page as $pagepath ) { if ( ! strpos( $pagepath, '/' ) ) { continue; } $pagepath_obj = get_page_by_path( $pagepath ); if ( $pagepath_obj && ( $pagepath_obj->ID == $page_obj->ID ) ) { return true; } } } return false; }
Any help will be appreciated.
- The topic ‘Trying to get property of non-object’ is closed to new replies.