Forums

[resolved] Change editor font and font size (6 posts)

  1. asandler
    Member
    Posted 1 year ago #

    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.

  2. alchymyth
    The Sweeper
    Posted 1 year ago #

    check add_editor_style();

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

    look into Twenty Ten for an example.

  3. asandler
    Member
    Posted 1 year ago #

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

  4. zoonini
    help me help you
    Posted 1 year ago #

    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!

  5. asandler
    Member
    Posted 1 year ago #

    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.

  6. zoonini
    help me help you
    Posted 1 year ago #

    Cool - thanks for sharing your solution.

Topic Closed

This topic has been closed to new replies.

About this Topic