Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm deeply confused by this one: I have a WordPress install on a Media Temple GS [one of many which work fine and are configured almost exactly the same] which is occasionally giving me 404s sitewide. When this happens I get 3 errors together in my PHP error log:

[01-Nov-2013 22:20:50 UTC] PHP Notice:  Trying to get property of non-object in /nfs/---/---/mnt/---/domains/---.---/html/wp-includes/post-template.php on line 275
[01-Nov-2013 22:20:50 UTC] PHP Notice:  Trying to get property of non-object in /nfs/---/---/mnt/---/domains/---.---/html/wp-includes/post-template.php on line 209
[01-Nov-2013 22:20:50 UTC] PHP Notice:  Trying to get property of non-object in /nfs/---/---/mnt/---/domains/---.---/html/wp-includes/post-template.php on line 29

The first two relate to the $post object & the 3rd to this: get_post()->ID; Which I think is the creation of the $post object.

I have two of these identical trios of error messages almost exactly 25 minutes apart [off by 2s].

I've tried MT support but they think it must be a WP error. I'm running the latest version of WP but have experienced this problem with earlier versions.

I had 2 plugins enabled: W3 Total Cache & AJAX Thumbnail Rebuild

I've tested with and without the cache plugin and the problem persists. I've just disabled the thumbnail plug to see if it makes any difference.

Please help this is driving me insane! [and I wanted to publicly launch this site today]

EDIT

I should have also mentioned that I have seen this error on some but not all of the other wordpress installs on this server. I think but cannot be 100% sure, that those showing errors are newer installs than the ones working fine. Though all installs are fully updated.

EDIT2

I'm just working on another WP project and realised at least what those 3 errors mean. I can reproduce exactly those three php errors by going to the index page of a custom post type that does not exist. However this doesn't explain why that would cause the 404 in this question, especially as it doesn't just happen only on custom post type index pages. However I think this must be related to custom post types in some way.

share|improve this question
    
Sidewide means on all pages/post/categories but not in wp-admin, so basically any frontend page? ps: disabling the W3TC plugin doesn't remove all caching functionality immediately. The better way is to disable caching on the main options page of the plugin and this really sounds like a caching / cache configuration issue. –  s1lv3r Nov 2 '13 at 9:44
    
Yes sidewide means any frontend page but nothing in wp-admin. I don't think it can have anything to do with the W3 Cache plugin as I was having this problem occasionally in development before that was enabled. –  iiz Nov 4 '13 at 3:54
2  
Are those the only three notices? My hunch is that your database is dropping out, but that would usually trigger its own notice. –  Matthew Boynes Nov 8 '13 at 15:08
    
I get only these three notices exactly when this error occurs. It happens between 2-3 times an hour and I can see no pattern in its timing. It can happen when trying to access any page not just home/archives. The level of PHP loggin is set to 32767 [E_ALL]. I think I previously tried WP_DEBUG and saw nothing but can't be sure. Now the site in question is live [! no option on this]. But I can do another hidden install with the same parameters as this if you think that would be worth it. –  iiz Nov 8 '13 at 20:01
    
What do your MySQL logs have near the same time? You may have to turn on logging for the experiment. –  s_ha_dum Nov 11 '13 at 4:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.