Okay
  Public Ticket #2072425
Can I upload my own font?
Closed

Comments

  • alyssabrady0316 started the conversation

    Hello! I was wondering if it was possible for me to upload my own font to use on the headers of my website. 


    I would like to use the same font that is in my logo (Kallita Script) on the slider rev and headings on my website. I have the .otf font file on my computer. Is it possible to upload the font into this theme and use it? 

  •  886
    Linh replied

    Hello

    You can add this code to functions.php file of child theme to import custom font:

    // Add custom font to font select
    add_filter( 'kirki_fonts_standard_fonts', 'brook_child_add_custom_font' );
    function brook_child_add_custom_font( $fonts ) {   $fonts['poppinsvn'] = array(      'label'    => 'poppinsvn',      'variants' => array( 100, '100italic',  300, '300italic', 'regular', 'italic', 500, '500italic', 600, '600italic', 700, '700italic', 800, '800italic', 900, '900italic' ),      'stack'    => 'poppinsvn, sans-serif',   );   return $fonts;
    }
    // Enqueue custom font
    add_action( 'brook_enqueue_custom_font', 'brook_child_enqueue_custom_font' );
    function brook_child_enqueue_custom_font ( $font ) {   if( $font === 'poppinsvn' ) {       wp_enqueue_style( 'poppinsvn', get_stylesheet_directory_uri() . '/assets/fonts/poppinsvn/poppinsvn.css', null, null );   }
    }
    

    Thanks

  • alyssabrady0316 replied

    I haven't downloaded my child theme yet. How do I do that?

  •  886
    Linh replied

    You can get it in my attachment.

    Thanks

    Attached files:  brook-child.zip

  • alyssabrady0316 replied

    I have the attachment, but am a little confused on how to upload it to my site or where to put it? I've read the article on Wordpress.com's blog but I'm still confused. 

  •  886
    Linh replied

    Hello

    Just install it as normal theme and activate it to use.

    Thanks