Trying to get property of non-object in … inc/template-tags.php on line 61

26. kesäkuuta 2015 klo 18.57
Sijainti: Vianhallintajärjestelmät: Github
Avainsanat: WordPress

Hi,

I’m getting this entry in my server log when I open the latest post in single-post view:

Trying to get property of non-object in [...]/wp-content/themes/cover/inc/template-tags.php on line 61

It looks like the reference to $next->ID on said line is causing this; there’s no next post from the newest, obviously. There is a test for ! $next && ! $previous on line 51, but I’m guessing the block generating$next_img_array for next_post_link should also be wrapped with a separate test for the existence of$next, to suppress the error.

Vastaa viestiin sen kontekstissa (Github)