Can I override the values loaded by add_theme_support in function.php?
-
I’m setting up a site based on the Twenty Seventeen theme and that theme includes in its function.php file a section to set the size of the custom-logo:
add_theme_support( 'custom-logo', array( 'width' => 250, 'height' => 250, 'flex-width' => true, ) );
The site’s logo is 946 wide by 250 high. It is easy enough to load the 946 x 250 logo using the default configuration and then using the crop handles to increase the crop area from 250 to 946 (which does change the image name from logo.png to cropped-logo.png, but that’s a minor annoyance), BUT I would like to have the “Suggested image dimensions:” line that’s displayed when loading a new logo using the Site Identity screen to show 946 by 250 pixels rather than 250 by 250.
I could make the change in the function.php file, but that would go away with the first update, so I’d like to do something in the child theme’s function.php, but since the child function.php loads first, any values in that file are overwritten.
I did try adding
add_action( 'after_setup_theme', 'set_theme_custom_logo_size' );
to the child function.php, but it fires before the parent function.php loads, so the parent settings still control the size.Any suggestions?
- The topic ‘Can I override the values loaded by add_theme_support in function.php?’ is closed to new replies.