[Resolved] Double space in editors

Home Forums Support [Resolved] Double space in editors

Home Forums Support Double space in editors

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1164949
    trevor

    Hello, when I use the default WP editor in backend for creating posts, I also have frontend plugin but I disabled for checking. Every time I hit return by default it double spaces between each sentence.

    Please.. How do I stop this? If I use a different theme the issue goes away, I am really not sure why you would want double spacing between sentences.

    It is driving me mad.

    #1165127
    David
    Staff
    Customer Support

    Hi there,

    GP doesn’t interfere with how the editor behaves.
    So either plugin conflict – check by disabling all plugins including GP Premium disabled.
    Or a bad function in a Child Theme or a Hook Element – can you check these as well.

    Let me know

    #1166013
    trevor

    disabled all plugins still same issue
    activated 2016 theme problem goes away, when I press return in editor no double space, I activate Generate Press and I get double space in editor when I press return.

    #1166051
    David
    Staff
    Customer Support
    #1166108
    trevor

    Yippee!

    That worked added the CSS , thank you Sir!

    #1166115
    David
    Staff
    Customer Support

    Was the line-height the issue? Or the bottom margin ?
    If so you can change that in Customizer > Typography > Body

    https://docs.generatepress.com/article/typography-overview/

    #1166464
    trevor

    It was line height.
    I just put it under general css, but will try adding it to body.

    #1166540
    trevor

    Hello, I looked at Customizer > Typography > Body

    that changes line height all over the content, my issue is just with editors backend and front end.

    #1166577
    Leo
    Staff
    Customer Support

    I don’t think we are really understanding the problem.

    Are you able to provide a screenshot or guide us to the element you are referring to?

    You can upload screenshots using a site like this if needed:
    https://postimages.org/

    Let us know πŸ™‚

    #1166585
    trevor

    Hi, not sure how else to explain…..

    When you go to create a new post…

    You type a line of text and press enter. instead on one space , you get a double space, the only way around it is to press SHIFT+Enter.

    This is really terrible solution as my users wont want to do this.
    If I activate another theme eg 2016 theme I don’t have this problem.

    I only have this problem in the editor , create new post…

    So when I am typing I get

    this a line

    this is the next line

    Double spacing…. not wanted.

    #1166588
    Leo
    Staff
    Customer Support

    I believe what you are referring to is the Paragraph margin option under Typography > Body.

    Let me know πŸ™‚

    #1167937
    trevor

    Hi, just to update,

    This is down to the fact that WordPress uses Tinymce editor.
    Customizer in front end does not override this. so I ( after a lot of googling) created found this.

    It need to be added to functions.php

    function trluk_add_editor_style( $mceInit ) {

    $custom_css = get_theme_mod( ‘custom_css’ );
    $styles = ‘.mce-content-body p{ line-height: .5 !important; ‘ . $custom_css . ‘; }’;

    if ( !isset( $mceInit[‘content_style’] ) ) {
    $mceInit[‘content_style’] = $styles . ‘ ‘;
    } else {
    $mceInit[‘content_style’] .= ‘ ‘ . $styles . ‘ ‘;
    }
    return $mceInit;
    }
    add_filter( ‘tiny_mce_before_init’, ‘trluk_add_editor_style’ );

    #1168189
    Leo
    Staff
    Customer Support

    Ok sounds good.

    Make sure that code is added in the child theme’s function.php πŸ™‚

    #1168452
    trevor

    Just notice that when I copied and pasted into editor text was over itself so I changed it to:

    function kwh_add_editor_style( $mceInit ) {

    $custom_css = get_theme_mod( ‘custom_css’ );
    $styles = ‘.mce-content-body p{ line-height: 1.5 !important; margin: 0; padding 0’ . $custom_css . ‘; }’;

    if ( !isset( $mceInit[‘content_style’] ) ) {
    $mceInit[‘content_style’] = $styles . ‘ ‘;
    } else {
    $mceInit[‘content_style’] .= ‘ ‘ . $styles . ‘ ‘;
    }
    return $mceInit;
    }
    add_filter( ‘tiny_mce_before_init’, ‘kwh_add_editor_style’ );

    This now works when I paste in the editor.

    #1168455
    Leo
    Staff
    Customer Support

    Thanks for reporting back!

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.