• While chasing for faster page load time, I noticed the theme loads admin-ajax.php for Customizer CSS function, which increases page load time. The URL generates a list of CSS stylesheet.

    https://my.blog/wp-admin/admin-ajax.php?action=independent_publisher_customizer_css&ver=1.7

    How to disable the theme function call for Customizer CSS?

    Can I copy & paste the CSS output and save into a CSS file? I hope to load the CSS via my CDN and I don’t need to customize theme CSS after I am set.

    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Theme Author Raam Dev

    (@raamdev)

    Yes, you can add the following to the bottom of functions.php (preferably in a Child Theme) and this will dequeue the Customizer CSS before it’s output:

    add_action( 'wp_print_styles', 'remove_independent_publisher_customizer_css' );
    function remove_independent_publisher_customizer_css(){
        wp_dequeue_style( 'customizer' );
    }
    Thread Starter lcf

    (@lcf)

    Thank you, @raamdev

    This has 2 seconds of TTFB loading time on my server so without it is much better. Only problem is that it now defaults to the standard and putting the necessary css in the child theme style.css file is not working for everything. Any ideas how that could be the case @raamdev?

    @erikvisser I’m facing the same problem. My optimization plugin (Autoptimize) does not optimize this and it adds up to 3 seconds to my loading times.

    Any other options, @raamdev?

    If this is custom css, you could migrate it to the WordPress core customizer’s “additional css” (introduced in WordPress 4.6 I think) in which case it’s outputted as inline CSS which Autoptimize will pick up and optimize?

    frank

    Theme Author Raam Dev

    (@raamdev)

    It’s not Custom CSS that the user adds themselves but rather CSS that is dynamically applied depending on the options and customizations selected in the Theme Customizer (e.g., text color changes).

    I haven’t looked into the latest Customizer changes, so there may be a better way of handling the output of that dynamically-generated custom CSS. If so, I’m happy to work on updating the theme to utilize the new Customizer.

    I work on the theme in my spare time and I’m quite busy right now, so it may be a few months before I get to it—unless someone wants to submit a Pull Request on GitHub. ?? https://github.com/raamdev/independent-publisher

    • This reply was modified 7 years, 5 months ago by Raam Dev.

    Maybe there’s an option (or filter) to force the CSS to be added inline instead of through the more expensive ajax call? ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to remove dynamic CSS Customizer?’ is closed to new replies.