{"id":1871,"date":"2009-02-04T11:39:18","date_gmt":"2009-02-04T09:39:18","guid":{"rendered":"http:\/\/mummila.net\/nuudelisoppa\/?p=1871"},"modified":"2009-02-04T11:39:18","modified_gmt":"2009-02-04T09:39:18","slug":"wordpress-and-wrong-numposts","status":"publish","type":"post","link":"https:\/\/mummila.net\/nuudelisoppa\/2009\/02\/04\/wordpress-and-wrong-numposts\/","title":{"rendered":"WordPress and wrong $numposts?"},"content":{"rendered":"<p>After a fresh WordPress installation, I was dumbfounded for a while when a simple &#8220;<code>global $numposts; echo $numposts;<\/code>&#8221; would always print N+1 despite the total number of posts actually being N. Turns out I had forgot to delete the initial &#8220;About&#8221; page, which obviously isn&#8217;t listed among the posts, but among pages, yet gets included when <code>$numposts<\/code> is calculated.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After a fresh WordPress installation, I was dumbfounded for a while when a simple &#8220;global $numposts; echo $numposts;&#8221; would always print N+1 despite the total number of posts actually being N. Turns out I had forgot to delete the initial &#8220;About&#8221; page, which obviously isn&#8217;t listed among the posts, but among pages, yet gets included [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[9387,30,26],"class_list":["post-1871","post","type-post","status-publish","format-standard","hentry","tag-blog","tag-bugsglitches","tag-open-source"],"_links":{"self":[{"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/posts\/1871","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/comments?post=1871"}],"version-history":[{"count":0,"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/posts\/1871\/revisions"}],"wp:attachment":[{"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/media?parent=1871"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/categories?post=1871"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/tags?post=1871"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}