• Resolved ispreview

    (@ispreview)


    Hi,

    Firstly, thanks for this excellent mod. I wasn’t fan of the font change and this makes it much easier to read.

    However, while I am happy to have the extra CSS injected into my private admin pages, I don’t want that same code to load on my public facing pages and have no need for it there. Is there any way I can get this removed from the public pages without taking it away from the admin CP too?

    <link rel='stylesheet' id='admin-custom-font-files-css'  href='https://fonts.googleapis.com/css?family=Open+Sans%3A400%2C700&subset=cyrillic%2Ccyrillic-ext%2Cgreek%2Cgreek-ext%2Clatin-ext%2Cvietnamese&ver=Open+Sans' type='text/css' media='all' />
    <link rel='stylesheet' id='admin-custom-font-frontend-toolbar-css'  href='https://www.MYSITE.net/wp-content/plugins/admin-custom-font/css/admin-custom-font-toolbar.css?ver=4.6.1' type='text/css' media='all' />
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Darko A7

    (@darko-a7)

    Hi @ispreview,

    sorry for late reply, never received email notification about your issue (probably because WP was switching over to new forum lately).

    Anyway, the code is necessary for admin/editor/user toolbar when they are logged in.

    If you do not wish to have them, simply comment-out the hook that use them – and done! In latest version 2.4.4 this is practically the last line of code in main plugin file admin-custom-font.php before the php closing tags:

    locate this (line #476):

    add_action('wp_enqueue_scripts', 'admin_custom_font_frontend_toolbar');

    replace with this:

    // add_action('wp_enqueue_scripts', 'admin_custom_font_frontend_toolbar');

    However, keep in mind that this will restore your toolbar with default system font (whatever that is – for different users it will be different), so it may cause some inconsistency.

    Also, the font line resource will still be loaded in your frontend, as this would be a bit complicated to remove with the current plugin’s code (it was optimized to remove redundancy, it did not take care of this particular case).

    Regards

    • This reply was modified 8 years, 3 months ago by Darko A7.
    Plugin Author Darko A7

    (@darko-a7)

    P.S. not sure if you understand this, but the code for toolbar is never injected for guests/visitors into your site’s source code in the first place — only for logged-in users who have some sort of an account in your website (readers, editors, admins) and access to toolbar.

    • This reply was modified 8 years, 3 months ago by Darko A7.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Removing the CSS Injection from public pages’ is closed to new replies.