This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

How to dequeue google fonts

Home Forums Product Support Forums Ajax Search Pro for WordPress Support How to dequeue google fonts

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #9671
    luyendaoluyendao
    Participant

    Hi there,

    I’m a bit of a performance nut, is there a way to dequeue the Lato and Open-Sans (Google fonts) loaded by the plugin.

    It seems to be loaded even if I use the theme inherited font. I tried adding this to functions.php, but it didn’t work. Any suggestions?

    [code]add_action( ‘wp_enqueue_scripts’, function() {
    wp_dequeue_style( ‘wpdreams-fonts’ );
    }, 99 );[/code]

    Thanks!

    #9673
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi!

    There is no working custom code to handle this, as the action is added via a singleton class which does not exist when the theme is initalized.

    You can however bypass it by editing the ajax-search-pro\includes\classes\actions\class-asp-customfonts.php file, by removing/disabling lines 23-24:

    [php]$_cf = WD_ASP_Search_Shortcode::getInstance();
    $_cf->fonts();[/php]

    Just remove those lines, or put them into comments.

    ——–

    I’m going to add a filter to the upcoming release, so you won’t have to do this again after update. In the next update just use this code:

    [php]add_filter(‘asp_custom_fonts’, ‘asp_null_css’);
    function asp_null_css($css_arr) {
    return array();
    }[/php]

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.