TinyMCE Advanced
[resolved] font-size select not in pt (4 posts)

  1. Maurizio Spicuglia
    Posted 3 years ago #

    i found this code to change the default font-size select from pt to px.

    add the following code in your functions.php file.

    // Add custom text sizes in the font size drop down list of the rich text editor (TinyMCE) in WordPress
    // $initArray is a variable of type array that contains all default TinyMCE parameters.
    // Value 'theme_advanced_font_sizes' needs to be added, if an overwrite to the default font sizes in the list, is needed.

    function customize_text_sizes($initArray){
       $initArray['theme_advanced_font_sizes'] = "10px,11px,12px,13px,14px,15px,16px,17px,18px,19px,20px,21px,22px,23px,24px,25px,26px,27px,28px,29px,30px,32px,48px";
       return $initArray;
    // Assigns customize_text_sizes() to "tiny_mce_before_init" filter
    add_filter('tiny_mce_before_init', 'customize_text_sizes');

    hope this will be useful..


  2. madxpo
    Posted 2 years ago #

    Thank Maurizio,
    It is very helpful.

    Just in case people are wondering you can use pt and em as well.

  3. dirtyx
    Posted 2 years ago #

    Simply perfect!
    It works like a charm.

  4. mkaterina77
    Posted 2 years ago #

    This code i insert in functions.php of my theme?
    This code works and for the new version of tinymce?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • TinyMCE Advanced
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic