How can I set the main theme-font dynamically, in WordPress
Posted
by windyjonas
on Stack Overflow
See other posts from Stack Overflow
or by windyjonas
Published on 2010-05-01T22:00:22Z
Indexed on
2010/05/01
22:07 UTC
Read the original article
Hit count: 256
I have created a theme where I already have a custom options page where I let the user set text for footer, twitter user and some other things and that works well. Now i'd like to add the functionality of letting the user select which font that should be used for content on the site. How can i accomplish this? I can probably create a php file that outputs something like:
<style type="text/css">
body{
font-family: <?php echo get_option('my-font');?>;
}
</style>
and include that file in header.php, but that means that I have to hit php for every request for this css and I want to avoid that if posssible.
© Stack Overflow or respective owner