• Guido

    (@guido07111975)


    Hi,

    For my theme I have added the add editor style function:
    http://codex.wordpress.org/Function_Reference/add_editor_style

    1) File Functions:

    function themename_editor_styles() {
    	add_editor_style( 'custom-editor-style.css' );
    	$font_url = '//fonts.googleapis.com/css?family=Open+Sans';
    	add_editor_style( str_replace( ',', '%2C', $font_url ) );
    	}
    add_action( 'init', 'themename_editor_styles' );

    2) Added file in root of my theme folder, called: custom-editor-style.css
    3) Included style from my theme stylesheet (file style.css): @import url( ‘style.css’ );

    When I create new post > no difference in editor screen… What am I doing wrong? I guess I should notice a difference in editor screen…

    Guido

Viewing 2 replies - 1 through 2 (of 2 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Check your browser’s console log to see if you’re getting any HTTP errors

    Thread Starter Guido

    (@guido07111975)

    Shame on me, I was editing wrong theme 🙁

    Works fine now, but changed my code in file functions:

    add_editor_style( array( 'custom-editor-style.css' ) );

    And added al my basic markup in file custom-editor-style.css +

    @import url(//fonts.googleapis.com/css?family=Open+Sans);

    Works fine, hopefuly theme will be approved with this ;-).

    Guido

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add editor style not working’ is closed to new replies.