redux-framework icon indicating copy to clipboard operation
redux-framework copied to clipboard

Typography field outputting font-weight & font-style

Open Webcreations907 opened this issue 12 years ago • 3 comments

Hello,

Tried checking to see if this had been asked before, but couldn't find. Sorry new to Github so not sure how everything works here yet. :)

I'm trying to enter/add a typography field, just blank though no defaults set. So shouldn't output anything until one of the font fields are set, but it's outputting font-weight:normal; and font-style:normal; css.

I edited the field_typography.php file so it checks to see if font-family or font-weight was set so that it doesn't output that. But I know this will have to be done each time I update ReduxCore, so hoping it might get looked into. ;)

This is the field

array(
    'id'        => 'opts-typography-body',
    'type'      => 'typography',
    'title'     => __('Body Font', 'redux-framework-demo'),
    'subtitle'  => __('Specify the body font properties.', 'redux-framework-demo'),
    'google'    => true,
    'text-align' => false,
    'letter-spacing' => true,
    'font-backup' => true,
    'output'    => array('body')

)

And if you were to leave all fields blank/unchanged and save options, it would output the below in CSS

body{
font-weight:normal;
font-style:normal;
}

Below is link to changes made to field_typography.php file, if that's of any help.

https://gist.github.com/Webcreations907/80bf00a06cb2cfa9197e#file-field_typography-php-L685-L702 https://gist.github.com/Webcreations907/80bf00a06cb2cfa9197e#file-field_typography-php-L725-L737

Thanks, and you all are doing a GREAT job on this project. :)

Webcreations907 avatar Aug 23 '14 04:08 Webcreations907

Okay, so I finally got around to playing with this for a bit, and I don't see any immediate problems with it. I'll add this to the next push and credit you. Kudos! :)

kprovance avatar Aug 25 '14 18:08 kprovance

Hey Guys, I have the same problem:

array(
    'id'        => 'typography-body',
    'type'      => 'typography',
    'title'     => __('Body Font', 'redux-framework-test'),
    'subtitle'  => __('Specify the font for the body text.<br /><em>Default: Lato</em>', 'redux-framework-growtheme'),
    'google'    => true,
    'font-style'=> false,
    'font-weight'=> false,
    'font-size' => false,
    'line-height'=> false,
    'text-align'=> false,
    'subsets'   => false,
    'color'     => false,
    'default'   => array(
        'font-family'   => 'Lato',
    ),
    'output'    => array (
        'font-family'   => 'body',
    )
),

Outputs

body{font-family:Lato;font-weight:normal;font-style:normal;}

jaschaio avatar Mar 16 '15 09:03 jaschaio

Please do not piggy back old issues with new ones. Please open your own issue, and include the information from #1975

kprovance avatar Mar 16 '15 13:03 kprovance