{"id":1850673,"date":"2011-01-07T19:48:29","date_gmt":"2011-01-07T19:48:29","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/error-in-functionsphp-1\/"},"modified":"2016-08-19T22:00:59","modified_gmt":"2016-08-19T22:00:59","slug":"error-in-functionsphp-1","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/error-in-functionsphp-1\/","title":{"rendered":"error in functions.php"},"content":{"rendered":"<p>Hi, I&#8217;m trying to add custom function is_child to functions.php file<\/p>\n<p>and I&#8217;m getting the error:<br \/>\nParse error: syntax error, unexpected T_FUNCTION in \/home\/content\/45\/7069945\/html\/wp-content\/themes\/mountain-dawn\/functions.php on line 8<\/p>\n<p>this is my functions.php<\/p>\n<pre><code>&lt;?php\n\nif ( function_exists(&#039;register_sidebars&#039;) )\nregister_sidebars(2);\n\nRemove_action(&#039;wp_head&#039;, &#039;wp_generator&#039;);\n\nfunction is_child($parent) {\n\tglobal $wp_query;\n\tif ($wp_query-&gt;post-&gt;post_parent == $parent) {\n\t\t$return = true;\n\t}\n\telse {\n\t\t$return = false;\n\t}\n\treturn $return;\n}\n?&gt;<\/code><\/pre>\n<p>any suggestion?<\/p>\n","protected":false},"template":"","class_list":["post-1850673","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1850673","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1850673\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=1850673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}