I am working on a theme for Wordpress and I want to add a function where a user can in the theme options select a font they want to use for their content etc
I have the basics working using the following in my options and functions files, the following are just the excerpts of the code for this particular issue;
in my options.php file
PHP Code:
$options[] = array(
'name' => __('Content Font', 'flexiness'),
'desc' => __('Select the font you want to use for your main content areas.', 'flexiness'),
'id' => 'content_font',
'type' => 'select',
'std' => 'arial', // as default
'options' => array(
'arial' => 'Arial/Helvetica',
'arial_blk' => 'Arial Black',
'comic' => 'Comic Sans MS',
'georgia' => 'Georgia',
'impact' => 'Impact',
'lucida' => 'Lucida Sans Unicode',
'palatino' => 'Palatino Linotype',
'tahoma' => 'Tahoma',
'times' => 'Times New Roman',
'trebuchet' => 'Trebuchet MS',
'verdana' => 'Verdana, Geneva, sans-serif')
);
then in my functions php file which gets its content from the options chosen above
PHP Code:
$flexiness_content_font = flexiness_option('content_font', 'arial'); // this is the default
Then, noting there is other style code above this including the opening style tag
I will be adding Google font options as an alternative hence the if and or's, if they choose the google fonts instead it will output the required google link code instead of the following
PHP Code:
if ($flexiness_content_font == 'arial' || 'arial_blk' || 'comic' || 'georgia' || 'impact' || 'lucida' || 'palatino' || 'tahoma' || 'times' || 'trebuchet' || 'verdana'); {
echo '
h1, h2, h3, h4, h5, h6, #theme-link, #nav-main .nav-main a, #nav-top .nav-top a, .my-title {font-family:' . ($flexiness_content_font) . ';}
</style>' . "\n";}
The end result is that if 'arial_blk' is selected it outputs of course 'arial_blk'. How can I get it to instead output the full name like 'Arial Black', or for 'comic', output 'Comic Sans MS'
I'm sure there is a better and more efficient way to do the above, but for now I just need to work out how I get it to output the full name.
Hoping the above is enough to make sense
Bookmarks