Functions.php in child theme
-
Following on from some difficulties I was having a few days ago (very helpfully resolved!)…
I asked about creating a functions.php file in my Emphaino child theme and was advised:
“Don’t worry if you don’t understand the above, simply do as I say below:
1) Copy the function emphaino_setup() from the functions.php of the parent theme (lines 58 to 135).
2) Paste it into the child theme’s function.php.
3) Look for the code set_post_thumbnail_size( 150, 150, true ); in the child theme’s functions.php (pasted code) and change the values to whatever you want.
4) Save the file and upload as applicable.”I tried doing that.
1) I copied from:
function emphaino_setup() {
to…
add_theme_support( ‘post-formats’, array(
‘aside’, ‘audio’, ‘chat’, ‘gallery’, ‘image’, ‘link’, ‘quote’, ‘status’, ‘video’
) );(I think that’s lines 58-135.)
—
2) I pasted that into the functions.php file I created in my child theme directory.
—
3) I changed:
set_post_thumbnail_size( 150, 150, true );
to…
set_post_thumbnail_size( 300, 0, false );
(Because I want to set a width of 300px, and retain the original aspect ratio without cropping.)
—
4) I saved the file and uploaded it.
BUT
When I refreshed my blog, I found that all of the code I’d entered into the child theme’s functions.php now appeared as text at the top of every page, including my WordPress dashboard.
Have I done something wrong?
- The topic ‘Functions.php in child theme’ is closed to new replies.