No results found. Try again with different words?

Search must be at least 3 characters.

    How to Add a New Google Font?

    Description

    The cp_add_google_fonts filter allows adding Google font to existing Google font list.

    Usage

    // Filter callback function
    function example_callback( $fonts ) {
        
       // update fonts here 
    
        return $fonts;
    }
    add_filter( 'cp_add_google_fonts', 'example_callback', 10 );
    

    Parameters

    $fonts:
        (array) array of existing fonts 
    

    Example

    /**
     * Add Google Font "Mogra" to existing font list
     *
     * @param array $fonts 
     * @return array 
     */
    function google_font_callback( $fonts ) {
        // Here Mogra is font family and 400 is font weight
        $fonts["Mogra"] = array(
            "400"
        );
    
        return $fonts;
    }
    add_filter( 'cp_add_google_fonts', 'google_font_callback', 10 );  

    Note: Make sure font family and weight are correct to apply font.

    Was this article helpful?

    Did not find a solution? We are here to help you succeed.

    Related Docs

    Grab Our Biggest Discount Of All Time. Don’t Miss Out!

    00
    Months
    00
    Days
    00
    Hours
    00
    Minutes
    00
    Seconds

    Grab this rare opportunity to save up to 50%

    WOAH, HOLD ON THERE!

    Don't Miss Our Biggest Discount

    00
    Months
    00
    Days
    00
    Hours
    00
    Minutes
    00
    Seconds

    You are backed by 100% risk-free money-back guarantee.

    Compare Convert Pro with...

    29439
    29440
    Scroll to Top