{"id":7420,"date":"2014-06-12T03:16:17","date_gmt":"2014-06-12T03:16:17","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/06\/12\/parse-error-syntax-error-unexpected-endif-t_endif-when-trying-to-view-post-collection-of-common-programming-errors\/"},"modified":"2014-06-12T03:16:17","modified_gmt":"2014-06-12T03:16:17","slug":"parse-error-syntax-error-unexpected-endif-t_endif-when-trying-to-view-post-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/06\/12\/parse-error-syntax-error-unexpected-endif-t_endif-when-trying-to-view-post-collection-of-common-programming-errors\/","title":{"rendered":"Parse error: syntax error, unexpected &#39;endif&#39; (T_ENDIF), when trying to view post-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9da1fe0ca09c408213402533ff38812c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nhalfer<\/p>\n<p>I have just installed a new wordpress theme and while viewing a single post I get the following error:<\/p>\n<pre><code>Parse error: syntax error, unexpected 'endif' (T_ENDIF) in\nC:\\xampp\\htdocs\\wordpress\\wp-content\\themes\\amzola\\loop-single.php on line 313\n<\/code><\/pre>\n<p>The error indicates there is an unexpected <code>endif<\/code> statement on line 313 of the file loop-single.php.<\/p>\n<p>I notice on line 272 this theme&#8217;s code declares:<\/p>\n<pre><code>$orig_post = $post;\n$global $post;\n<\/code><\/pre>\n<p>and later reverts the variable with:<\/p>\n<pre><code>$post = $orig_post;    \n<\/code><\/pre>\n<p>This seems incorrect, as <code>$post<\/code> will be <code>NULL<\/code> before it is globalized, therefore this logic will essentially empty the WordPress $post variable. Is it possible this action is causing a PHP error before the <code>endif<\/code> statement, throwing the above error code?<\/p>\n<p>How can I easily check errors in my WordPress website?<\/p>\n<p>Here is my php code of loop-single.php of a WordPress theme:<\/p>\n<pre><code>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    \n\n            \n\n            \n\n                \n\n                     \n\n                \n\n            \n\n            \n\n                \n\n                    \n\n                \n\n            \n\n              \n\n            \n\n        \n\n        \n\n            \n\n                  \n\n                 -  )<\/code><\/pre>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>halfer I have just installed a new wordpress theme and while viewing a single post I get the following error: Parse error: syntax error, unexpected &#8216;endif&#8217; (T_ENDIF) in C:\\xampp\\htdocs\\wordpress\\wp-content\\themes\\amzola\\loop-single.php on line 313 The error indicates there is an unexpected endif statement on line 313 of the file loop-single.php. I notice on line 272 this theme&#8217;s [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7420","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7420","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7420"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7420\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7420"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7420"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7420"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}