Title: [Plugin: OptionTree] Retrieving Typography Values
Last modified: August 20, 2016

---

# [Plugin: OptionTree] Retrieving Typography Values

 *  [lspoor](https://wordpress.org/support/users/lspoor/)
 * (@lspoor)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-optiontree-retrieving-typography-values/)
 * Hey guys, with the Typograph option I can retrieve the values using
 * `$type = get_option_tree( 'type' );`
 * But how do I get the values specifically?
 * So if I want to add the font family to my CSS what do I use to get it?
 * I tried
 * `<?php echo $type['font-family']; ?>`
 * But that doesn’t work, it just outputs a comma for some reason, any ideas what
   I’m doing wrong. I’m a newbie to this so it would of been cool for examples on
   how to use them all but I guess I’ll have to learn 🙂
 * [http://wordpress.org/extend/plugins/option-tree/](http://wordpress.org/extend/plugins/option-tree/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [tdschrock](https://wordpress.org/support/users/tdschrock/)
 * (@tdschrock)
 * [14 years ago](https://wordpress.org/support/topic/plugin-optiontree-retrieving-typography-values/#post-2686997)
 * Hey, I just have been trying to get this figured out as well….If you don’t want
   to manually use the ‘get_option_tree()’ function and parse out the proper info
   into the correct css properties, you can do this…
 * You’ll need the following OptionTree fields set up:
    just one field of type CSS
   however many font options you want set up (for my theme, I’m using three)
 * In the CSS box setting type this:
 *     ```
       #id-name-here {
       {{key-of-typography-field-here}}
       }
       ```
   
 * Then, in your theme file include the line (typically in your header.php file):
 *     ```
       <link rel="stylesheet" href="<?php bloginfo('template_directory');?>/dynamic.css" type="text/css" />
       ```
   
 * Then, in your html markup just use the id or class name
    example:
 *     ```
       <div id="id-name-here">formatted text here</div>
       ```
   
 * Just for kicks, check out what OptionTree did to the file dynamic.css.
 *  [tdschrock](https://wordpress.org/support/users/tdschrock/)
 * (@tdschrock)
 * [14 years ago](https://wordpress.org/support/topic/plugin-optiontree-retrieving-typography-values/#post-2686998)
 * PS:
 * You will have to go into the plugin files and change one line in the file functions.
   php.
 * Line 272 should read
 *     ```
       $font[] = "color: " . $value['font-color'] . ";";
       ```
   
 * I don’t know why, but it currently (version 1.1.8.1) reads:
 *     ```
       $font[] = "font-color: " . $value['font-color'] . ";";
       ```
   
 * This places a property called “font-color” in the file “dynamic.css” and there
   is no such property. CSS uses the property “color”

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: OptionTree] Retrieving Typography Values’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/option-tree_363534.svg)
 * [OptionTree](https://wordpress.org/plugins/option-tree/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/option-tree/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/option-tree/)
 * [Active Topics](https://wordpress.org/support/plugin/option-tree/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/option-tree/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/option-tree/reviews/)

## Tags

 * [Retrieving](https://wordpress.org/support/topic-tag/retrieving/)
 * [values](https://wordpress.org/support/topic-tag/values/)

 * 2 replies
 * 2 participants
 * Last reply from: [tdschrock](https://wordpress.org/support/users/tdschrock/)
 * Last activity: [14 years ago](https://wordpress.org/support/topic/plugin-optiontree-retrieving-typography-values/#post-2686998)
 * Status: not resolved