Forum has been created to help all our customers in properly working our theme. We offer complete help with configuration theme and make default look, just like on our Be|theme demo. We don`t offer theme customization.


Before creating a new discussion, please:
1. Check on forum if discussion hasn`t been created before. Use the forum Search on the right.
2. Read carefully the documentation included to package.
3. If you didn`t find what you need and would like to post a new question click the "Start a New Discussion" button on the right.
4. You can post on forum only after registration (you need purchase code to register) .


NOTE!!! If you are starting a new topic and have got problems with your site and you want us to check what`s wrong please always give url to your site because without that we can`t check what`s wrong. Each case may be different because of your installed plugins, servers or other things.


IMPORTANT!!! Along with your inquiry, please attach the address of the page which concerns the question. This will cause the time to answer on your question will be much shorter. If you do not want to publish your address publicly in the forum, please send a private message. Thanks!

Google Fonts Short Code - Line height

Hi team,

Is it possible to change the line height when using the Google Font short code? If not, could you add it as a feature please?

It looks to default to the same as the font size, but I need more control. Also being able to superscript and subscript would also be handy if possible. I have tried a work around using <span> and <div> but couldn't get it working, unless you know of another solution....?

Thanks

Comments

  • Please sign in to see answear!
  • No, sorry let me explain again.

    I am using the "Google_font" shortcode - [google_font font="Open Sans" size="25" weight="400" italic="0" letter_spacing="" color="#fff" subset=""]Insert your <br />content here[/google_font]

    I want to be able to control the line height independently of the font size but there is no attribute available in the short code to edit, but it is present in the CSS.

    Am I able to edit the Google_font shortcode to add the "line-height" attribute and put it in my child theme for future use?

    Thanks
  • Please sign in to see answear!
  • Thanks Pablo. I'll add it to the list, I managed to customise the files anyway.

    For anyone wanting to know how. I customised the theme-shortcode.php file to get it working anyway and added it to my Child theme.

    /**
     * Google Font [google_font]
     */

    if (! function_exists('sc_google_font')) {
    function sc_google_font($attr, $content = null)
    {
    extract(shortcode_atts(array(
    'font' => '',

    'size' => '25',
    'line_height' => '25',
    'weight' => '400',

    'italic' => '',
    'letter_spacing' => '',
    'subset' => '',

    'color' => '',
    'inline' => '',
    ), $attr));

    // style

    $style_escaped = array();
    $style_escaped[] = "font-family:'". esc_attr($font) ."',Arial,Tahoma,sans-serif;";
    $style_escaped[] = "font-size:". intval($size, 10) ."px;";
    $style_escaped[] = "line-height:". esc_attr($line_height, 10) ."px;";
    $style_escaped[] = "font-weight:". esc_attr($weight) .";";
    $style_escaped[] = "letter-spacing:". intval($letter_spacing, 10) ."px;";

    if ($color) {
    $style_escaped[] = "color:". esc_attr($color) .";";
    }

    Also, edit the scripts.js file in files theme > functions > builder > js > script.js to add in the field to the shortcode when placed in the editor:

    '[google_font font="Open Sans" size="25" line-height="25" weight="400" italic="0" letter_spacing="" color="#626262" subset=""]Insert your content here[/google_font]',
Sign In or Register to comment.