I have a theme and I need to override some specific parts|behavior of it specifically on the functions.php
file. I know the best practice here is doing this at child theme by placing a custom functions.php
. Now this is part of the original file:
function mytheme_setup() {
...
add_image_size( 'mytheme-l-thumbs' , 750 , 423 , true);
add_image_size( 'mytheme-m-thumbs' , 555 , 313 , true);
add_image_size( 'mytheme-s-thumbs' , 450 , 254 , true);
add_image_size( 'mytheme-square-thumbs' , 750 , 750 , true);
add_image_size( 'mytheme-nocrop-thumbs' , 750 , 1500 , false);
}
add_action( 'after_setup_theme', 'mytheme_setup' );
And I want to override each add_image_size
by set crop
to false on my child theme. I have tried by copying & pasting the function on child theme but I ended up with this error:
Cannot redeclare mytheme_setup() (previously declared in /themes/mytheme-child/functions.php:11) in /themes/mytheme/functions.php on line 88
How I can do that?