Build online communities, sell courses & memberships on WordPress Support Forums Solutions Social Blogger Add typekit and stop theme from loading any other fonts

Tagged: 

Viewing 12 posts - 1 through 12 (of 12 total)
  • Question

    #58882
    @stackstreetnew

    Hello,

    Ive integrated Typekit into my theme and I want to remove any loading of other fonts by the theme.

    Also, how do I remove the CSS that is generated by that area of the theme settings (looks like its called “dynamic-css” in the html)? In order to override it i included a !important in my new font in custom CSS, but i'd like to get this setup in a cleaner fashion (its currently being injected to the html, see screenshot).

    Also no need to load any other fonts that are not used.

    Thanks!

    Answers

    #58993
    @vapvarun

    Hi @stackstreetnew,

    Theme option css are added as inline css. Adding them as file create issues on some hosting due to permission issues.
    Earlier we have used the same approach by adding all css inside option.css but lots of customers have issues with it.

    Regards

    #59029
    @stackstreetnew

    Yes I know they are added inline — that was my question. How do I turn off the theme generating these? Also, how do i turn off the theme loading any fonts.

    I'm using typekit with all custom styling, and dont need any of the theme generated inline styling from the theme options page OR any fonts.

    Thanks!

    #59122
    @vapvarun

    Hi @stackstreetnew, These will need to edit core file.

    I have suggested to consider custom font type option along with Typekit

    Regards

    #59452
    @stackstreetnew

    Ok it would be awesome to get this done. It makes no sense to load all these different font files.

    Even if it was just an action/hook to unregister all of those fonts. Thanks!

    #59674
    @vapvarun

    hi @stackstreetnew,
    We will push updates in next couple of days and it will have option to remove fonts
    Regards

    #60962
    @stackstreetnew

    Were you able to complete this? Thanks!

    #60968
    @vapvarun

    Hi @stackstreetnew
    we have added onesocial_font_options hook to filter font family

    /onesocial/buddyboss-inc/buddyboss-framework/options-init.php line 783

    
    'fields' => apply_filters( 'onesocial_font_options', $font_options )
    

    You can use it to remove those font family which you do not want to add
    Regards
    Varun Dubey

    #60971
    @stackstreetnew

    i dont want to load any fonts at all.. just my Typekit ones i added myself manually…

    #61834
    @vapvarun

    Hi @stackstreetnew
    You can add following inside child theme functions.php

    
    function fonts_fallback( $font_options ) {
        return;
    }
    add_filter( 'onesocial_font_options', 'fonts_fallback');
    

    Regards
    Varun Dubey

    #65365
    @stackstreetnew

    I added that and it removed the options from the theme menu, but the theme still calls “<link rel='stylesheet' id='redux-google-fonts-onesocial_options-css' href='https://fonts.googleapis.com/css?family=Merriweather%3A900&ver=1458955260′ type='text/css' media='all' />”

    please fix!

    #67422

    Sagar
    Keymaster
    @sagar

    Hello @stackstreetnew,

    I hope you’re doing well. Firstly, I’d like to apologize for the delay in response. Thank you for your patience all this while.

    Please put the following lines of code in functions.php of your child theme. It will remove google font link added by redux option.

    /**
     * Remove all google fonts loading by redux
     */
    if ( !function_exists( 'remove_redux_google_font' ) ) {
    
    	function remove_redux_google_font() {
    		wp_deregister_style('redux-google-fonts-onesocial_options');
    		wp_dequeue_style('redux-google-fonts-onesocial_options');
    	}
    
    	add_action( 'wp_enqueue_scripts', 'remove_redux_google_font', 999 );
    }

    Let me know if you need more assistance.

    Thanks

Viewing 12 posts - 1 through 12 (of 12 total)
  • The question ‘Add typekit and stop theme from loading any other fonts’ is closed to new replies.