So I know there currently isn’t an option available for a “font selector” field (although that would be pretty sweet). I’m looking to essentially make a “select” field populated with a list of font choices for my WordPress theme. I can easily make the select field and add all my font options in, and then incorporate the different fonts in my style.php, however I’m not sure how I could go about displaying a preview of the font family on the admin panel. For example, I want every font choice in my select field to actually be displayed in that font face instead of the standard font.
Would this involve custom styles? How could I go about doing this?
Hi @thoughtspacewebsites
This can be achieved by the following steps:
1. Add some jQuery to the wp-admin which looks at the select field and uses each option’s value to add a class to the option tag. This will allow you to target the option elements with CSS
2. Add some CSS to the wp-admin which uses the previous classes to add the font-family attribute!
Good luck
Thanks
E