Add New Google Fonts To The Typography Font List
This is a Developer Level doc.
If you're unfamiliar with PHP and/or editing files, codes and templates, as well as with resolving possible conflict, please seek help from a professional. Under our Support Policy, we don't provide support for modifications and customization.
The OceanWP theme contains almost all (1500+) available Google fonts. However, in case there are new fonts, you can add them easily with this PHP snippet. Do not use it unnecessarily if the font already exists.
You can add new Google fonts by using the following PHP snippet:
function my_new_fonts( $array ) { $array[] = 'Poppins'; return $array; } add_filter( 'ocean_google_fonts_array', 'my_new_fonts' );
Alter the $array[]
value per your need.
All PHP snippets should be added via a child theme's functions.php file.