- This topic has 14 replies, 3 voices, and was last updated 4 years, 2 months ago by Leo.
-
AuthorPosts
-
February 14, 2020 at 2:23 am #1164949trevor
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.
February 14, 2020 at 5:58 am #1165127DavidStaffCustomer SupportHi 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
February 15, 2020 at 3:53 am #1166013trevordisabled 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.February 15, 2020 at 4:55 am #1166051DavidStaffCustomer SupportFebruary 15, 2020 at 6:05 am #1166108trevorYippee!
That worked added the CSS , thank you Sir!
February 15, 2020 at 6:11 am #1166115DavidStaffCustomer SupportWas the line-height the issue? Or the bottom margin ?
If so you can change that in Customizer > Typography > BodyFebruary 15, 2020 at 12:07 pm #1166464trevorIt was line height.
I just put it under general css, but will try adding it to body.February 15, 2020 at 3:05 pm #1166540trevorHello, I looked at Customizer > Typography > Body
that changes line height all over the content, my issue is just with editors backend and front end.
February 15, 2020 at 4:30 pm #1166577LeoStaffCustomer SupportI 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 π
February 15, 2020 at 4:43 pm #1166585trevorHi, 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.
February 15, 2020 at 4:48 pm #1166588LeoStaffCustomer SupportI believe what you are referring to is the Paragraph margin option under Typography > Body.
Let me know π
February 17, 2020 at 6:09 am #1167937trevorHi, 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’ );February 17, 2020 at 8:29 am #1168189LeoStaffCustomer SupportOk sounds good.
Make sure that code is added in the child theme’s
function.php
πFebruary 17, 2020 at 12:17 pm #1168452trevorJust 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.
February 17, 2020 at 12:19 pm #1168455LeoStaffCustomer SupportThanks for reporting back!
-
AuthorPosts
- You must be logged in to reply to this topic.