• I’m trying to install the open sans font for my wordpress site. I want to use this font when i’m making a new post, i tried adding a font from google.com/fonts and pasting it in between my <head/> tag and <body> tag in my header.php file but it doesn’t work. How can i do this? BTW i’m a beginner at this, so solutions that talk step by step go here do this would be appreciated.

Viewing 1 replies (of 1 total)
  • You could simply add this to your custom CSS style file, or using a plugin like “simple custom css” :

    @import url(https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,300,400,700);
    body {
    	font-family: 'Open Sans', sans-serif!important;
    }

    If it didn’t work, add this to your functions.php file:

    function wp_enqueue_custom_font() {
    	?>
    		<link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,300,400,700' rel='stylesheet' type='text/css'>
    		<style type="text/css" media="all">body { font-family: 'Open Sans', sans-serif!important; }</style>
    	<?php
    }
    add_action('wp_head', 'wp_enqueue_custom_font');
Viewing 1 replies (of 1 total)
  • The topic ‘How can i install a custom font on my wordpress?’ is closed to new replies.