Posts by valendesigns

119 posts
  • Attended a Community Meetup
  • Author had a File in an Envato Bundle
  • Bought between 50 and 99 items
  • Elite Author
  • Envato Staff
  • Exclusive Author
  • Has been a member for 5-6 years
+3 more
valendesigns Staff says

Derek, it’s possible to make an array looks not like that like at Parker’s link:
Array
(
    [font-family] => font-family: 'Abel', sans-serif;
    [font-name] => Abel
    [css-name] => Abel
)

But it like that:

Array
(
    'Abel' => 'Abel',
)
Or do u suggest to fill in Google Fonts array manually?

No, changing the typography option is not on the table it would cause to many issues. If you want a google font option type we need to come up with a way to build the font stack so the output adds the proper google fonts and everything works properly.

119 posts
  • Attended a Community Meetup
  • Author had a File in an Envato Bundle
  • Bought between 50 and 99 items
  • Elite Author
  • Envato Staff
  • Exclusive Author
  • Has been a member for 5-6 years
+3 more
valendesigns Staff says




Just wanted to mention that OptionTree is the 36th most popular plugin in the WP Directory at the moment. Thanks everyone! Also, 2.0.8 should fix all the backwards compatibility issues and I’ve added a way to download your settings into a theme-options.php and it’s not just a var_export() either.

Hi derek,

with v2.0.8 if you export the settings.php with define(‘WP_DEBUG’, true); the php file exported is full of notices…

Parker
I updated 2.0.8 with issets but I didn’t update the version number. Just download again.
Thanks a lot Derek for all your work!

You’re very welcome! Hopefully the changes in the last week have helped make the transition a little smoother for 1.x themes.

119 posts
  • Attended a Community Meetup
  • Author had a File in an Envato Bundle
  • Bought between 50 and 99 items
  • Elite Author
  • Envato Staff
  • Exclusive Author
  • Has been a member for 5-6 years
+3 more
valendesigns Staff says


Just wanted to mention that OptionTree is the 36th most popular plugin in the WP Directory at the moment. Thanks everyone! Also, 2.0.8 should fix all the backwards compatibility issues and I’ve added a way to download your settings into a theme-options.php and it’s not just a var_export() either.

Hi derek,

with v2.0.8 if you export the settings.php with define(‘WP_DEBUG’, true); the php file exported is full of notices…

Parker

I updated 2.0.8 with issets but I didn’t update the version number. Just download again.

119 posts
  • Attended a Community Meetup
  • Author had a File in an Envato Bundle
  • Bought between 50 and 99 items
  • Elite Author
  • Envato Staff
  • Exclusive Author
  • Has been a member for 5-6 years
+3 more
valendesigns Staff says

Ok, start adding right now, then share when I finished.

Before you do all that we would need to figure out the best way to do all the font variations. i don’t think a list of 500+ fonts to choose from would be all that beneficial.

119 posts
  • Attended a Community Meetup
  • Author had a File in an Envato Bundle
  • Bought between 50 and 99 items
  • Elite Author
  • Envato Staff
  • Exclusive Author
  • Has been a member for 5-6 years
+3 more
valendesigns Staff says





Hey, guys, could u say please why this doesn’t work?
function filter_ot_recognized_font_families( $array, $field_id ) {

  /* only run the filter when the field ID is my_google_fonts_headings */
  if ( $field_id == 'primary_typography-family' ) {
    $array = array(
      'sans-serif'    => 'sans-serif',
      'open-sans'     => '"Open Sans", sans-serif',
      'droid-sans'    => '"Droid Sans", sans-serif'
    );
  }

  return $array;

}
add_filter( 'ot_recognized_font_families', 'filter_ot_recognized_font_families', 10, 2 );
I still don’t have new fonts at select field :(
Then your field ID is incorrect.
Where could I find this field id? This isn’t an id of font-family select?
The field ID is whatever you set the typography option to on the settings page. Go to your setting page, find your specific option and click the edit button and the ID is the second input field.
Ups :) Thanks, Derek and Parker, sorry for my stupid questions. Should I input all 501 Google Fonts in the array or there is another way?

Only add the ones you theme uses. however, If you do add all 501 please share and I add a google font option type.

119 posts
  • Attended a Community Meetup
  • Author had a File in an Envato Bundle
  • Bought between 50 and 99 items
  • Elite Author
  • Envato Staff
  • Exclusive Author
  • Has been a member for 5-6 years
+3 more
valendesigns Staff says




Just wanted to mention that OptionTree is the 36th most popular plugin in the WP Directory at the moment. Thanks everyone! Also, 2.0.8 should fix all the backwards compatibility issues and I’ve added a way to download your settings into a theme-options.php and it’s not just a var_export() either.

Hi derek,

with v2.0.8 if you export the settings.php with define(‘WP_DEBUG’, true); the php file exported is full of notices…

WP_DEBUG must always set to true when developing...
Parker
Debug mode is on for my local setup and I have zero notices. Also, it’s alway set to true I’m not an idiot.

I get this: http://pastie.org/4305774

Parker

That’s most likely because you created your own settings array. Had you used the UI builder to setup the settings array non of those would be showing because the UI builder sets all the array values even if they are empty. I’ll add an isset to everything for people who didn’t use the UI builder in the first place.

119 posts
  • Attended a Community Meetup
  • Author had a File in an Envato Bundle
  • Bought between 50 and 99 items
  • Elite Author
  • Envato Staff
  • Exclusive Author
  • Has been a member for 5-6 years
+3 more
valendesigns Staff says



Hey, guys, could u say please why this doesn’t work?
function filter_ot_recognized_font_families( $array, $field_id ) {

  /* only run the filter when the field ID is my_google_fonts_headings */
  if ( $field_id == 'primary_typography-family' ) {
    $array = array(
      'sans-serif'    => 'sans-serif',
      'open-sans'     => '"Open Sans", sans-serif',
      'droid-sans'    => '"Droid Sans", sans-serif'
    );
  }

  return $array;

}
add_filter( 'ot_recognized_font_families', 'filter_ot_recognized_font_families', 10, 2 );
I still don’t have new fonts at select field :(
Then your field ID is incorrect.
Where could I find this field id? This isn’t an id of font-family select?

The field ID is whatever you set the typography option to on the settings page. Go to your setting page, find your specific option and click the edit button and the ID is the second input field.

119 posts
  • Attended a Community Meetup
  • Author had a File in an Envato Bundle
  • Bought between 50 and 99 items
  • Elite Author
  • Envato Staff
  • Exclusive Author
  • Has been a member for 5-6 years
+3 more
valendesigns Staff says


Just wanted to mention that OptionTree is the 36th most popular plugin in the WP Directory at the moment. Thanks everyone! Also, 2.0.8 should fix all the backwards compatibility issues and I’ve added a way to download your settings into a theme-options.php and it’s not just a var_export() either.

Hi derek,

with v2.0.8 if you export the settings.php with define(‘WP_DEBUG’, true); the php file exported is full of notices…

WP_DEBUG must always set to true when developing...
Parker

Debug mode is on for my local setup and I have zero notices. Also, it’s alway set to true I’m not an idiot.

119 posts
  • Attended a Community Meetup
  • Author had a File in an Envato Bundle
  • Bought between 50 and 99 items
  • Elite Author
  • Envato Staff
  • Exclusive Author
  • Has been a member for 5-6 years
+3 more
valendesigns Staff says

Hey, guys, could u say please why this doesn’t work?
function filter_ot_recognized_font_families( $array, $field_id ) {

  /* only run the filter when the field ID is my_google_fonts_headings */
  if ( $field_id == 'primary_typography-family' ) {
    $array = array(
      'sans-serif'    => 'sans-serif',
      'open-sans'     => '"Open Sans", sans-serif',
      'droid-sans'    => '"Droid Sans", sans-serif'
    );
  }

  return $array;

}
add_filter( 'ot_recognized_font_families', 'filter_ot_recognized_font_families', 10, 2 );
I still don’t have new fonts at select field :(

Then your field ID is incorrect.

119 posts
  • Attended a Community Meetup
  • Author had a File in an Envato Bundle
  • Bought between 50 and 99 items
  • Elite Author
  • Envato Staff
  • Exclusive Author
  • Has been a member for 5-6 years
+3 more
valendesigns Staff says

Derek, thanks for your replies, could u explain what does this mean? if ( $field_id == ‘my_google_fonts_headings’ ) in Typography option for Custom Font-families. By the way, Derek, u see, here u can choose where to create your meta box, at post editor or page
/* Adds a box to the main column on the Post and Page edit screens */
function myplugin_add_custom_box() {
    add_meta_box( 
        'myplugin_sectionid',
        __( 'My Post Section Title', 'myplugin_textdomain' ),
        'myplugin_inner_custom_box',
        'post' 
    );
    add_meta_box(
        'myplugin_sectionid',
        __( 'My Post Section Title', 'myplugin_textdomain' ), 
        'myplugin_inner_custom_box',
        'page'
    );
}

http://codex.wordpress.org/Function_Reference/add_meta_box Maybe this info will be helpful.

The docs are updated in 2.0.8 please read them. Also, ‘my_google_fonts_headings’ is just a made up setting, you need to replace that with your own setting ID.

by
by
by
by
by
by