I believe to get this working I wasn’t calling this at the correct time, and I wrapped it in a function after_setup_theme, like so:
add_action( 'after_setup_theme', 'ttp_custom_font_sizes' );
function ttp_custom_font_sizes() {
// removes custom font sizes
add_theme_support('disable-custom-font-sizes');
// add my own custom sizes
add_theme_support( 'editor-font-sizes', array(
array(
'name' => __( 'Small'),
'size' => 12,
'slug' => 'small'
),
array(
'name' => __( 'Normal'),
'size' => 16,
'slug' => 'normal'
),
array(
'name' => __( 'Large'),
'size' => 36,
'slug' => 'large'
),
array(
'name' => __( 'Huge'),
'size' => 50,
'slug' => 'huge'
)
) );
}
Related Posts:
- Add colors to existing color palette without replacing it
- create-guten-block in wordpress theme?
- How to update mark-up of a gallery block in a custom theme?
- Correct way to make a custom block theme responsive
- Full site editing templates folder vs block-templates
- How to add multiple custom blocks in custom WordPress theme using create-block?
- Full Site Editing, Block Theme, Gutenberg, Site Editor
- get_template_part vs action hooks in themes
- Using classes instead of global functions in functions.php
- How to move page template files like page-{slug}.php to a sub-directory?
- Add custom classes to anchor in wp_nav_menu
- Are the WordPress Core CSS styles really all nessesary?
- Allow Shortcode in Theme Customizer
- Where to post/upload the new theme for WordPress theme repository
- Setting multiple default background images?
- Template for individual post designs
- How to make a theme with more than one CSS file?
- Pushing updates to your premium theme
- Where can I find a good reviewed collection of Twenty Ten child themes?
- How do I get gallery thumbnail URL and change the default thumbnail size?
- Can you filter posts by meta key with the getEntitityRecords selector?
- Select menu on browser resize
- add_theme_support( ‘custom-header’ ) does not add option menu in dashboard
- CSS in child theme not overriding the parent theme [closed]
- Can I upload WordPress-react theme in Wp theme repository
- Advantages of using instead of wp_enqueue_style()?
- How to add dynamic inline style?
- Optimal solution to develop a wordpress theme?
- How to add suggest plugin to theme?
- Upgrading a custom theme through the Dashboard
- Prevent update check for specific theme
- Get list of months with posts
- Cannot get full thumbnail size using the_post_thumbnail
- WordPress Gutenberg Theme: Structure, Hierarchy and Custom Templates
- Version control for both Vagrant config and themes being developed [closed]
- Is there a way to activate different theme for specified users? [closed]
- how can I remove the sidebar from my wp homepage [closed]
- Does any theme support child theme?
- Am I supposed to create a child theme for every theme I use?
- using wordpress without javascript
- How do I save a wordpress theme’s files and install them on another site?
- Theme Check: Could not find post_class
- “add_theme_support” for custom footer color?
- Why wp_head() function not loading style.css?
- Override theme programmatically
- Set multiple templates per post
- WP 3.1 upgrade breaks AutoFocus+ theme
- How can I display/hide certain content based on a Theme Option field?
- How can I make that when I clic on one of the menu items, that page shows only posts with the same category?
- Theme Splash Image within the “Appearance -> Themes” control panel [duplicate]
- Theme Loading Into Dashboard
- How to make theme elements customizable in wordpress?
- How to add “Template” option in page attributes panel?
- How to edit my theme for full width?
- What VSCode extensions are there for working with block themes? [closed]
- How to check if a WordPress core block is active in sidebar
- Which html elements should be styled in wordpress theme
- How do you replace content generated by custom fields with custom blocks in Block Editor?
- Folder name for a pro version of a WordPress.org theme?
- Custom Blocks as part of a theme
- Admin: sub menu doesnt display under apperance when activate my themes
- Block editors annoying warnings
- Create a child theme from multiple themes
- Are seven additional image sizes are too many?
- How can I use the WordPress Loop and Pagination in multiple instances but different scenarios throughout my site?
- registering a global template wordpress 6.0
- How to add InnerBlock multiple times in the same block
- Copying the theme style files and images to duplicate the website but with a difference
- I have WordPress setup on primary domain, how do I set it up on its subdomain using the same database?
- How to set Post meta-box defaults based on the choices made by user in Customizer?
- Theme Action to hook for one time only function [duplicate]
- How do I include a partial from a directory below a wordpress theme directory?
- first excerpt fine, subsequent post excerpts shift to the right instead of displaying vertically [closed]
- HTTP Error when uploading images over specific dimensions
- Why is the `if else` not working?
- showing all recent posts in theme
- iPad WordPress theme?
- custom Background not showing after upgrade?
- Rolling your own WordPress Themes
- List categories of a post hierarchically?
- PHP Parse error: syntax error, unexpected ‘endwhile’ (T_ENDWHILE), expecting elseif (T_ELSEIF) or else (T_ELSE) or endif (T_ENDIF) on line 124
- Show popover with url and option to open in new window
- Posts Page shows Classic Editor interface not Gutenberg
- How to display home page last modified date in anywhere of wordpress theme?
- Is a multipurpose theme an alternative to modifying or creating a theme from scratch?
- WooCommerce – edit templates
- How to dowload and edit content of a website
- Best strategy for providing theme options using customizer
- Next post in category
- Trouble creating custom sanitization function when uploading video files
- What’s the policy for building a theme that doesn’t support widgets/menus?
- How Does One Create a Global Variable Repository
- Any Cool WordPress Theme Editor? [closed]
- getting id of page
- Is there any open source WordPress Themes?
- Template for posts of category in block theme?
- How to set the margin on an innerBlock in a block variation?
- Align images to the left of the content
- Activate Gutenberg group block for theme
- Disable interactivity for core navigation