Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #308078

    How would one apply a different font to a text block.
    There does not seem to be a way to chose the font you want to use when creating a font block (would be a great option).
    How would I got if for example I want a text block to use the Dancing Script font for example?

    Thanks in advance

    EDIT: by the way I don t mean to add another font to the admin panel css control for the whole site I want to be able to change the font used in certain text boxes only on a per case basis only

    EDIT2: I tried to apply inline style to a text block but that breaks the admin section as the js rewrites the blocks and adds shortcodes…so inline inside the text block does not seem to work. Is the solution to add a H1 style to the text block drop down and assign a font size and weight as a H12 for example? So the custom google font would need to be set for each style you want to use?

    #308157

    Hey Monsoon!

    Thank you for using Enfold.

    You can add unique css selector for each text blocks. Edit functions.php, find this code:

    if(isset($avia_config['use_child_theme_functions_only'])) return;
    

    Below, add this code:

    add_theme_support('avia_template_builder_custom_css');
    

    Create a text block then apply a unique selector on the Custom CSS field. Let’s use dancing-script for example. Use this on Quick CSS or custom.css to apply a different font family on the text block:

    .dancing-script > * {
    font-family: 'Dancing Script', cursive !important;
    }

    After that, add this on functions.php to call the google font script:

    function dancing_script() { ?>
    <link href='http://fonts.googleapis.com/css?family=Dancing+Script' rel='stylesheet' type='text/css'>
    <?php }
    
    add_action('wp_head', 'dancing_script');
    

    Cheers!
    Ismael

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.