Site logo

Archived topic

Custom Font in Editor & Hyphenation issues

5 replies · Started by Sascha on October 31, 2022

Viewing posts 1–6 of 6

Hi

on this site I have applied custom font "CourierNew", which is not rendered in the Editor, although I have added this filter:

add_filter( 'block_editor_settings_all', function( $editor_settings ) {
    $css = wp_get_custom_css_post()->post_content;
    $editor_settings['styles'][] = array( 'css' => $css );

    return $editor_settings;
} );

Secondly, I have applied a hyphenation-rule for enhancing readability:

body {
    -ms-hyphens: auto;
    -webkit-hyphens: auto;
    hyphens: auto;
}

but now I'd like to disable it for the email-address, which is displayed in the footer, which may lead to showing a wrong address. How can I disable it for this phrase?

Thank you in advance and kind regards,
Sascha

Hi there,

can you share a link to the site ?

Oops, sure, here it is, pls find admin-login in private note

Hi Sascha,

The PHP snippet you are using adds the CSS of additional CSS field to editor, but your @font-face CSS is in the child theme, so try this snippet instead:

add_filter( 'generate_editor_styles', function( $editor_styles ) {
    $editor_styles[] = 'your-editor-style.css';

    return $editor_styles;
} );

change the your-editor-style.css to the name of your stylesheet.

For the hyphen CSS, try this to override yours:

.site-footer span#eeb-903191-172554 {
    hyphens: none;
}

Hi Ying, thank you for your reply.

New snippet works perfectly, nice :)

The hyphen issue remains, as you can see on this screenshot. Or is this due to the margin or padding inside the footer-container?

Thank you in advance and kind regards,
Sascha

The hyphen issue is due to lack of space.
If you edit the Grid, and switch to Tablet view you can set each grid column to 50%.
That should make sure the columns are wide enough to keep that line intact.

This archived topic is closed to new replies.