Add font size dropdown to WordPress editor
This came in handy today so I thought I’d share it.
Add this snippet of code into your WordPress functions.php file and it will add a font size dropdown option in your WordPress editor.
The second function allows you to select what font type is used and also choose what font sizes should be in the dropdown. Used on WordPress 4.1.1.
function wp_editor_fontsize_filter( $buttons ) { array_shift( $buttons ); array_unshift( $buttons, 'fontsizeselect'); array_unshift( $buttons, 'formatselect'); return $buttons; } add_filter('mce_buttons_2', 'wp_editor_fontsize_filter'); |
function customize_text_sizes($initArray){ $initArray['fontsize_formats'] = "14px 15px 16px 17px 18px 19px 20px 21px 22px 23px 24px 26px 28px"; return $initArray; } add_filter('tiny_mce_before_init', 'customize_text_sizes'); |
Share this
Donations
All these templates are created as donationware, if you are going to use them in a commercial project or would like to contribute, please donate:
Looking for information about link removal? - Click Here
Recommended Hosting using Krystal Hosting
Use the code DWTCODE at checkout to help us and also receive £5 credit back
Get Hosting - Use code DWTCODE
Share This Page
Help us increase our exposure by sharing us across social media:
Number of Templates
26
Total Downloads
99975
Daily Downloads (Avg)
26