{"id":7558290,"date":"2016-07-09T16:58:02","date_gmt":"2016-07-09T16:58:02","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/code-wont-work-in-child-theme-functionsphp\/"},"modified":"2016-09-01T16:26:46","modified_gmt":"2016-09-01T16:26:46","slug":"code-wont-work-in-child-theme-functionsphp","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/code-wont-work-in-child-theme-functionsphp\/","title":{"rendered":"Code won&#039;t work in Child Theme Functions.php"},"content":{"rendered":"<p>I am editing this php file here: http:\/\/pastebin.com\/VuH3C1XH<\/p>\n<p><strong>Line 54<\/strong>. I need to replace this line with this code:<\/p>\n<pre><code>&lt;?php if (is_user_logged_in ()): ?&gt;\n    &lt;?php\n        $current_user = wp_get_current_user ();\n        echo get_avatar ($current_user-&gt;user_email, 100);\n    ?&gt;\n&lt;?php else: ?&gt;\n    &lt;img src=&quot;http:\/\/richtrix.com\/wp-content\/uploads\/2016\/07\/Register.jpg&quot; alt=&quot;No avatar is available&quot; \/&gt;\n&lt;?php endif; ?&gt;<\/code><\/pre>\n<p>I edited this on my parent theme (bad, I know) and the changes worked perfectly. I undid the changes and went to my child theme to implement this edit.<\/p>\n<p>Problem is, no matter how I edit my child theme functions.php, my website breaks down. Can someone please assist me in the correct way to make this edit?<\/p>\n<p>I would be so grateful! I am driving myself insane trying to do this.<\/p>\n<p>Jeff Arnold<\/p>\n","protected":false},"template":"","class_list":["post-7558290","topic","type-topic","status-publish","hentry","topic-tag-child-theme","topic-tag-function-php","topic-tag-parent-theme","topic-tag-php"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/7558290","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\/7558290\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=7558290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}