Support » Fixing WordPress » Change editor font and font size

  • Resolved asandler

    (@asandler)


    When editing posts from within administrator interface in 3.1, is there any way to change default editor font?
    I noticed that in 3.1 there is a new feature called Post formats: http://codex.wordpress.org/Post_Formats
    Can it be of any help? Remember I want to change font in the editor, not the way published post looks like.
    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Michael

    (@alchymyth)

    check add_editor_style();

    http://codex.wordpress.org/Function_Reference/add_editor_style

    look into Twenty Ten for an example.

    Thread Starter asandler

    (@asandler)

    @alchymyth, this is seems to be what I am looking for. Thanks.

    Moderator Kathryn Presner

    (@zoonini)

    If you would please mark this thread as “resolved” it would be appreciated. Helps everyone keep better track of whose issues are still outstanding. Thanks!

    Thread Starter asandler

    (@asandler)

    Yes. Sure.

    I got it working. I’ve written a small plug-in:

    function add_style($content) {
            add_editor_style();
            return $content;
    }
    add_action('init', 'add_style');

    Then I placed editor-style.css with following code in my theme:

    body.mceContentBody {
        font: 16px/19px Ubuntu,Calibri,Tahoma,Georgia,"Times New Roman","Bitstream Charter",Times,serif;
    }
    
    body.mceContentBody pre {
        16px/19px Consolas,"Courier New",Courier;
    }

    and it worked.
    So, again, thanks for helping me to figure this out.

    Moderator Kathryn Presner

    (@zoonini)

    Cool – thanks for sharing your solution.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Change editor font and font size’ is closed to new replies.