Created
October 18, 2018 22:10
-
-
Save josephdickson/002e010deac5f67ac53bd28e02875f36 to your computer and use it in GitHub Desktop.
Add to functions.php to customize font size options
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_enqueue_scripts', 'twenty_seventeen_gutenberg_enqueue_styles' ); | |
// Font size options | |
function mytheme_setup_theme_supported_features() { | |
add_theme_support( 'editor-font-sizes', array( | |
array( | |
'name' => __( 'extra small', 'themeLangDomain' ), | |
'shortName' => __( 'xs', 'themeLangDomain' ), | |
'size' => 10, | |
'slug' => 'extrasmall' | |
), | |
array( | |
'name' => __( 'small', 'themeLangDomain' ), | |
'shortName' => __( 's', 'themeLangDomain' ), | |
'size' => 12, | |
'slug' => 'extrasmall' | |
), | |
array( | |
'name' => __( 'regular', 'themeLangDomain' ), | |
'shortName' => __( 'R', 'themeLangDomain' ), | |
'size' => 16, | |
'slug' => 'regular' | |
), | |
array( | |
'name' => __( 'medium', 'themeLangDomain' ), | |
'shortName' => __( 'M', 'themeLangDomain' ), | |
'size' => 24, | |
'slug' => 'medium' | |
), | |
array( | |
'name' => __( 'large', 'themeLangDomain' ), | |
'shortName' => __( 'L', 'themeLangDomain' ), | |
'size' => 28, | |
'slug' => 'large' | |
), | |
array( | |
'name' => __( 'larger', 'themeLangDomain' ), | |
'shortName' => __( 'XL', 'themeLangDomain' ), | |
'size' => 36, | |
'slug' => 'larger' | |
) | |
) ); | |
// Add Pitzer Orange to the color palette block | |
add_theme_support( 'editor-color-palette', array( | |
array( | |
'name' => __( 'Pitzer Orange', 'themeLangDomain' ), | |
'slug' => 'pitzer-orange', | |
'color' => '#f7941d', | |
), | |
) ); | |
} | |
add_action( 'after_setup_theme', 'mytheme_setup_theme_supported_features' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Custom code to adjust font sizes available in the Gutenberg paragraph block.