a little more about this… i am using it in an options page to allow the user to change the fonts of the theme. i have extracted selected font name with the following:
<?php
$pFontField = get_field('p_font', 'option');
$pFont = array_values($pFontField)[0];
$addTitleFont = get_field('add_title_font', 'option');
if( $addTitleFont == true ) {
$titleFontField = get_field('title_font', 'option');
$titleFont = array_values($titleFontField)[0];
} else {
$titleFont = $pFont;
}
?>
and the css:
<style type="text/css">
body {
font-family: "<?php echo $pFont; ?>" !important;
}
h1, h2, h3, h4, h5, h6 {
font-family: "<?php echo $titleFont; ?>" !important;
}
</style>
there is following problem now though:
I have a check box for the user to select a different font for titles. Then it shows the second google font select field and applies that font to titles. Otherwise, it just applies the first selected ‘p_font’. The problem is, even if only one font is selected, it still stores the second in the database and loads it up in the header of the page.
Is there any way to get around this or control which fonts are being loaded?
Thank you for your help and this awesome plugin ??