{"id":4056614,"date":"2013-08-22T16:02:45","date_gmt":"2013-08-22T16:02:45","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/functionsphp-in-child-theme-2\/"},"modified":"2016-08-21T04:12:22","modified_gmt":"2016-08-21T04:12:22","slug":"functionsphp-in-child-theme-2","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/functionsphp-in-child-theme-2\/","title":{"rendered":"Functions.php in child theme"},"content":{"rendered":"<p>Following on from some difficulties I was having a few days ago (very helpfully resolved!)&#8230;<\/p>\n<p>I asked about creating a functions.php file in my Emphaino child theme and <a href=\"https:\/\/wordpress.org\/support\/topic\/inconsistent-appearance-using-emphaino?replies=5\">was advised<\/a>:<\/p>\n<p>&#8220;Don&#8217;t worry if you don&#8217;t understand the above, simply do as I say below:<\/p>\n<p>1) Copy the function emphaino_setup() from the functions.php of the parent theme (lines 58 to 135).<br \/>\n2) Paste it into the child theme&#8217;s function.php.<br \/>\n3) Look for the code set_post_thumbnail_size( 150, 150, true ); in the child theme&#8217;s functions.php (pasted code) and change the values to whatever you want.<br \/>\n4) Save the file and upload as applicable.&#8221;<\/p>\n<p>I tried doing that. <\/p>\n<p>1) I copied from:<\/p>\n<p>function emphaino_setup() {<\/p>\n<p>to&#8230;<\/p>\n<p>add_theme_support( &#8216;post-formats&#8217;, array(<br \/>\n&#8216;aside&#8217;, &#8216;audio&#8217;, &#8216;chat&#8217;, &#8216;gallery&#8217;, &#8216;image&#8217;, &#8216;link&#8217;, &#8216;quote&#8217;, &#8216;status&#8217;, &#8216;video&#8217;<br \/>\n) );<\/p>\n<p>(I think that&#8217;s lines 58-135.)<\/p>\n<p>&#8212;<\/p>\n<p>2) I pasted that into the functions.php file I created in my child theme directory.<\/p>\n<p>&#8212;<\/p>\n<p>3) I changed:<\/p>\n<p>set_post_thumbnail_size( 150, 150, true );<\/p>\n<p>to&#8230;<\/p>\n<p>set_post_thumbnail_size( 300, 0, false );<\/p>\n<p>(Because I want to set a width of 300px, and retain the original aspect ratio without cropping.)<\/p>\n<p>&#8212;<\/p>\n<p>4) I saved the file and uploaded it.<\/p>\n<p>BUT<\/p>\n<p>When I refreshed my blog, I found that all of the code I&#8217;d entered into the child theme&#8217;s functions.php now appeared as text at the top of every page, including my WordPress dashboard. <\/p>\n<p>Have I done something wrong?<\/p>\n","protected":false},"template":"","class_list":["post-4056614","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4056614","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\/4056614\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=4056614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}