Support » Plugin: OptionTree » [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 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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 {

    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

    <div id="id-name-here">formatted text here</div>

    Just for kicks, check out what OptionTree did to the file dynamic.css.


    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 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.