{"id":4818,"date":"2015-06-26T18:57:02","date_gmt":"2015-06-26T15:57:02","guid":{"rendered":"http:\/\/mummila.net\/kommentit\/?p=4818"},"modified":"2015-06-26T18:57:02","modified_gmt":"2015-06-26T15:57:02","slug":"trying-to-get-property-of-non-object-in-inctemplate-tags-php-on-line-61","status":"publish","type":"post","link":"https:\/\/mummila.net\/kommentit\/2015\/06\/26\/trying-to-get-property-of-non-object-in-inctemplate-tags-php-on-line-61\/","title":{"rendered":"Trying to get property of non-object in &#8230; inc\/template-tags.php on line 61"},"content":{"rendered":"<p>Hi,<\/p>\n<p>I&#8217;m getting this entry in my server log when I open the latest post in single-post view:<\/p>\n<pre><code>Trying to get property of non-object in [...]\/wp-content\/themes\/cover\/inc\/template-tags.php on line 61\r\n<\/code><\/pre>\n<p>It looks like the reference to <code>$next-&gt;ID<\/code> on said line is causing this; there&#8217;s no next post from the newest, obviously. There is a test for <code>! $next &amp;&amp; ! $previous<\/code> on line 51, but I&#8217;m guessing the block generating<code>$next_img_array<\/code> for <code>next_post_link<\/code> should also be wrapped with a separate test for the existence of<code>$next<\/code>, to suppress the error.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m getting this entry in my server log when I open the latest post in single-post view; there&#8217;s no next post from the newest, obviously.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8860],"tags":[2965],"class_list":["post-4818","post","type-post","status-publish","format-standard","hentry","category-vianhallintajarjestelmat","tag-wordpress","sijainti-github"],"_links":{"self":[{"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/posts\/4818","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/comments?post=4818"}],"version-history":[{"count":2,"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/posts\/4818\/revisions"}],"predecessor-version":[{"id":4820,"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/posts\/4818\/revisions\/4820"}],"wp:attachment":[{"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/media?parent=4818"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/categories?post=4818"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mummila.net\/kommentit\/wp-json\/wp\/v2\/tags?post=4818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}