echo font-family
Redux Framework v3.3.2.7 running as a plugin, using sample-config. WordPress v3.9.1
Thought this would be simple but obviously I'm missing something.
I just need to echo font-family with the font-backup
If I do this the backup font doesn't show unless I click Save Settings twice.
global $redux_demo;
echo $redux_demo['opt-typography']['font-family'];
Obviously I need to do more.
Any help would be very much appreciated
Jim
Fixed in latest push :)
Awesome! Works! Thanks!
Also if you define a default font-backup
'font-backup' => 'Arial, Helvetica, sans-serif',
And hit Reset or Reset Section it doesn't work, you have to hit Save Settings
I'm not entirely sure that one is solvable. Whomever wrote the original typography field - before my time - thought it would be a good idea to append the backup font to the [font-family] variable, which it isn't. It should have been left up to the dev to use [font-family] variable, followed by the [font-backup]. It's been out too long now to undo it without breaking a bunch of other devs' code. When Redux is reset, it dumps the default values back into the database, which doesn't include the font-backup in the font-family entry (hence, why putting it in there to begin with was a bad call). I don't see how it can forcibly be done, on a reset. Maybe @Dovy will have an idea, or know if it's even possible.
I agree, they should be separate.
I have one more little nit picky thing:
global $redux_demo;
echo $redux_demo['opt-typography']['letter-spacing'];
echo $redux_demo['opt-typography']['word-spacing'];
If you don't set a default word-spacing or letter-spacing value it leaves a stray "px" (on Save Settings). Line height and font size don't do that.
Not a big deal as default can be set to 0
Thanks
Okay, the 'px' appending issue should be resolved. I also separated the font-backup data from the font-family data, as it's kind of pointless. Make sure to use the font-backup variable to indicate backup fonts. This change doesn't affect the output/compiler font-family selector. Primary and backup fonts will still be appended using those functions.