Community Forums › Forums › Archived Forums › Design Tips and Tricks › Genesis Sample Child Theme Gutenberg functions
- This topic has 9 replies, 2 voices, and was last updated 5 years, 8 months ago by Victor Font.
-
AuthorPosts
-
March 21, 2019 at 6:21 am #490176Andreas BeerMember
I'm tweaking Genesis Sample Child theme and I'm wondering why these lines in functions.php don't have an effect.
// -- Disable custom font sizes add_theme_support( 'disable-custom-font-sizes' ); // -- Disable Custom Colors add_theme_support( 'disable-custom-colors' );
March 21, 2019 at 7:41 am #490178Victor FontModeratorIt's all in the timing. If you're adding those lines directly to functions PHP, they won't work. You have to hook them into the after_setup_theme action:
function disable_gutenberg_custom_fonts_and_colors() { add_theme_support( 'disable-custom-font-sizes' ); add_theme_support( 'disable-custom-colors' ); } add_action( 'after_setup_theme', 'disable_gutenberg_custom_fonts_and_colors' );
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?March 21, 2019 at 7:54 am #490180Andreas BeerMemberHm, that's a new idea. Not yet working, but maybe that's because I have 3 'after_setup_theme' occurences in my functions.php. Should I make try this kind of thing?
add_action( 'after_setup_theme' (array (...
March 21, 2019 at 8:53 am #490184Andreas BeerMemberAnyway, color palette and font size picker still showing up in full glory. Even with an array setting all sizes to 16 or an empty array that thing is still showing up. Where does that bad idea sneak in?
March 21, 2019 at 11:01 pm #490191Victor FontModeratorI just tried the code on Genesis Sample in my dev environment and it's working exactly as it should. The Sample theme also has it's own color pallet that is not affected by the code.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?March 22, 2019 at 3:17 am #490194Andreas BeerMemberThat would be version 2.9 of the sample theme. I've started working with 2.8. Seems I have to start all over. Thanks anyway, Victor.
March 22, 2019 at 7:40 am #490201Andreas BeerMemberOk, I switched to latest child theme version.
Butfunction disable_gutenberg_custom_fonts_and_colors() { add_theme_support( 'disable-custom-font-sizes' ); add_theme_support( 'disable-custom-colors' ); } add_action( 'after_setup_theme', 'disable_gutenberg_custom_fonts_and_colors' );
is still not having any effect.
March 23, 2019 at 8:07 am #490224Victor FontModeratorI'm working with V. 2.8 of the sample theme. I never said I was working with 2.9.
The code doesn't do much anyway. Removing the custom colors removes the multi-color button. It does not remove the custom colors defined in the theme.
The custom font sizes removes the numeric selector where you choose a specific pixel size. It does not remove the font selector drop down with the named sizes.
What did you want to happen?
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?March 25, 2019 at 1:50 am #490252Andreas BeerMemberActually, I'm striving to get these options out completely, along with several others, as they are giving users a weird idea about the flexibility of our corporate design.
March 25, 2019 at 8:07 am #490264Victor FontModeratorThe Sample theme adds it's own color palette. If you want to totally remove everything, you have to remove both the theme's customizations and the Gutenberg defaults.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet? -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.