• Resolved cashnerves

    (@cashnerves)


    Hey Support

    When we edit the Global Typography in the theme customization in OceanWP theme, the line height for example applies to WP Post Editor Area. I disabled the “Use theme styles” in the Editor but it still applies. I think its a bug, or idk because i’m not a developer. I tried to add function by using chatgpt in functions.php file but i think the chatgpt is not providing the right code.

    Code Added in functions.php file but none of them worked, the global typo. settings still applies

    // Exclude Customizer Typography Changes in the Editor
    function remove_global_typography_editor() {
    if (is_admin()) {
    echo '<style>
    body.block-editor-page .editor-styles-wrapper {
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    }
    </style>';
    }
    }
    add_action('admin_head', 'remove_global_typography_editor');




    ALSO TRIED THIS


    // Remove theme styles from the editor
    add_action('enqueue_block_editor_assets', function() {
    wp_deregister_style('oceanwp-style'); // Adjust 'oceanwp-style' with your theme's style handle
    });

    // Ensure theme styles still load for the frontend but not the editor
    add_action('after_setup_theme', function() {
    remove_theme_support('editor-styles');
    });



    ALSO THIS ( this one actually did the same as we turn off the "Use theme styles" option.



    add_action('admin_init', function() {
    remove_editor_styles();
    });

    In below images i tried to show the Global Typography settings i applied for testing and it also applies to the Editor Area of WordPress even the “Use theme styles” is off from the prefrences.

Viewing 1 replies (of 1 total)
  • Shahin

    (@skalanter)

    Hello @cashnerves,

    Thank you for reaching out,

    I guess you don’t need any code regarding this topic, kindly try to click on this area and choose your desired unit (px, em, %, etc): https://postimg.cc/9wRvRpm6

    Before that, please update the theme and Ocean Extra to the latest versions, we have improved the fonts section, and after changes try to clear all level caches, then you’ll see them; like this one: https://postimg.cc/hQf4Y7LS.

    Please let me know if you have any questions about the above steps.

    I hope it helps.
    Best Regards

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.