Adding custom fonts to typography
I'm so sorry if this has been answered before, I did a pretty specific search to check first. (site:https://github.com/ReduxFramework/ReduxFramework/issues font -google)
I've got a project that uses a mix of custom and Google fonts. For the header font, I need to default to "American Captain" but also include other options. I can't seem to figure out how I add a custom font list to the existing ones! I'm sure it's as simple as calling an array, however, I have been unable to find the solution in a timely manner by reading the typography php class files.
Thanks as always for taking a moment to help out.
If you want use custom typography, must you upload this font in your host/service, i think best solution for this issue using premium extension 'Custom Font Uploader Field' https://gist.github.com/dovy/7f9aadab732e69f5130d
I hope from @dovy gives us more details about this extension and when will be available on marketplace?
Yes, the font is uploaded. I'm replicating a prototype (http://dev.imperativeideas.com/drafts/fullbush/) into WordPress. While the client is unlikely to ever change the header fonts, it's nice to give them the option.
I can skip that for now and only allow manipulation of the body font. Hopefully @dovy will have a simple fix for including a custom font array. I do it all the time using the standard WP customizer but wanted to take Redux for a spin on this project.
Hmmm, for some reason, this isn't on the wiki. I'll have to see to that.
Anyways, in your typography config, you can add 'fonts' => $fonts where $fonts is an array of either standard fonts, or fonts you need to include with your project. For example:
$fonts = array ( 'Open Sans,arial,helvatica' => 'Open Sans', 'BebasRegular,arial,helvatica' => 'Bebas Regular', 'LeagueGothicRegular,arial,helvatica' => 'League Gothic Regular', 'Arial,helvetica,sans-serif' => 'Arial', 'helvetica,sans-serif,arial' => 'Helvatica', 'sans-serif,arial,helvatica' => 'Sans Serif', 'verdana,san-serif,helvatica' => 'Verdana' );
Those first three won't do anything for you unless you have them installed, or are refernecing them to a URL specified in your CSS file. But that's basic stuff you should know already. :)
Oh fantastic, thank you. You got that finished before I had even managed to finish defining the body font type!
+1 @kprovance
@kprovance I apologize for asking this here, but after many, many hours of googling, I just couldn't find a solution. I have a theme that ships with Redux Framework inside. I'm using a child theme, where I customized some stuff. Now is it possible to make the above solution work from a child theme?
Overall I'm trying to disable any loading of Google Fonts and include just my own, without touching the original theme in case of future updates. Would the above solution even be the proper way to do it? BTW, I would purchase the Custom Fonts Uploader extension if that would help, but it has been discontinued apparently....
@dovy - I've added my custom font as an option in the Redux Panel with:
'fonts' => array(
'Market Deco' => 'Market Deco'
)
However, this replaces all the standard fonts. How could I add my Market Deco font to the existing standard fonts?
You are replacing the array, not appending to it, and why anything in it is now gone. Basic PHP.