Title: PHP error
Last modified: October 10, 2016

---

# PHP error

 *  [immeronline](https://wordpress.org/support/users/immeronline/)
 * (@immeronline)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/php-error-204/)
 * Hi
    I get the following error in my logfile: [09-Oct-2016 18:51:01 UTC] PHP Notice:
   Trying to get property of non-object in /var/www/borneyogahulen.dk/teenyogaspace.
   com/wp-content/plugins/conditional-menus/init.php on line 268
 * Do you know what it is about?
 * Thomas

Viewing 1 replies (of 1 total)

 *  [mas15ogu](https://wordpress.org/support/users/mas15ogu/)
 * (@mas15ogu)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/php-error-204/#post-8782336)
 * I’m able to replicate the problem on a fresh installation of WP. Do the following:
   
   1. Install Conditional Menus 2. Create a new menu 3. Add a conditional menu with
   the condition to be viewed for “Sample Page”, i.e. a page. 4. Go to the home 
   page (or the search page) 5. Get the error `Trying to get property of non-object
   in /var/www/borneyogahulen.dk/teenyogaspace.com/wp-content/plugins/conditional-
   menus/init.php on line 268`
 * The reason this error appear is because when doing `$query_object->post_name`
   this object is null, because `get_queried_object();` returned null. I haven’t
   read the code good enough to know the correct solution, but for me it was to 
   add `! is_search()` and `! is_front_page()` to the `if`-statement on line 266.
    -  This reply was modified 9 years, 3 months ago by [mas15ogu](https://wordpress.org/support/users/mas15ogu/).

Viewing 1 replies (of 1 total)

The topic ‘PHP error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/conditional-menus.svg)
 * [Conditional Menus](https://wordpress.org/plugins/conditional-menus/)
 * [Support Threads](https://wordpress.org/support/plugin/conditional-menus/)
 * [Active Topics](https://wordpress.org/support/plugin/conditional-menus/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/conditional-menus/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/conditional-menus/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [mas15ogu](https://wordpress.org/support/users/mas15ogu/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/php-error-204/#post-8782336)
 * Status: not resolved