{"id":4132,"date":"2020-05-23T19:54:47","date_gmt":"2020-05-23T19:54:47","guid":{"rendered":"https:\/\/the7kennisbank.nl\/?p=4132"},"modified":"2020-05-23T19:54:47","modified_gmt":"2020-05-23T19:54:47","slug":"add-custom-font","status":"publish","type":"post","link":"https:\/\/the7kennisbank.nl\/en\/dream-theme-support-portal\/add-custom-font\/","title":{"rendered":"Add custom font"},"content":{"rendered":"<p>Add custom font<\/p>\n<div id='wrapper'>\n<div class='inner-content'>\n<p><strong>1)<\/strong> Upload font files to your website, for example, into &hellip;\/wp-content\/uploads\/fonts\/ or your child theme folder, make sure you are uploading Webfonts, you can generate Webfont files <a href='https:\/\/www.fontsquirrel.com\/tools\/webfont-generator'>here<\/a><\/p>\n<p><strong>2)<\/strong>Then add @font-face in Theme Option &gt; Advacned &gt; Custom CSS this way:<\/p>\n<pre class='brush: css; title: ; notranslate' title=''>@font-face {font-family: 'Gruppo';src: url('\/wp-content\/uploads\/fonts\/Gruppo_reg.eot');src: url('\/wp-content\/uploads\/fonts\/Gruppo_reg.eot') format('embedded-opentype'),url('\/wp-content\/uploads\/fonts\/Gruppo_reg.woff') format('woff'),url('\/wp-content\/uploads\/fonts\/Gruppo_reg.ttf') format('truetype'),url('\/wp-content\/uploads\/fonts\/gruppo_reg.svg#Gruppo') format('svg');}<\/pre>\n<p><strong>3)<\/strong> Add new font to the Theme options font list<\/p>\n<p>Please add the following code into the end of your <strong>child theme<\/strong> functions.php file:<\/p>\n<pre class='brush: php; title: ; notranslate' title=''>function add_custom_font( $fonts ) {$fonts['Gruppo'] = 'Gruppo';\/\/to add more fonts, just define they like this\/\/$fonts['my-font-family'] = 'my-font-name';return $fonts;}add_filter( 'presscore_options_get_safe_fonts', 'add_custom_font' ,30 , 1 );<\/pre>\n<p>Where is <strong>my-font-family<\/strong> , it is a font-family that you have set in the <em>font-face<\/em> css, and <strong>my-font-name<\/strong> it is a font name that you will see in the theme font list.<\/p>\n<p>Now This font is available in Theme Options &gt; Typography &gt; font list.<\/p>\n<p>Note: If you want to specify font with a weight you can do this using the following code notation in add_custom_font() function.<\/p>\n<pre class='brush: css; title: ; notranslate' title=''>$fonts['Gruppo:500'] = 'Gruppo(500)'; \/\/for 500 weight$fonts['Gruppo:700'] = 'Gruppo(700)'; \/\/for 700 weight<\/pre>\n<p>Alternatively (instead of step 3), you can also apply font using custom CSS like this, but you will have to apply it to many different selectors depends on your requirements.<\/p>\n<p><code>body, p, h1, h2 {<br \/><\/br>font-family: 'Gruppo' !important;<br \/><\/br><\/code><\/p>\n<p><strong id='typkit'>Adding Adobe Typekit font<\/strong><\/p>\n<p><strong>1)<\/strong> Add the script provided by typekit to Theme options -&gt; Advanced -&gt; Custom JavaScript.<\/p>\n<p><strong>2)<\/strong> Follow step 3 above.<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Add custom font 1) Upload font files to your website, for example, into &hellip;\/wp-content\/uploads\/fonts\/ or your child theme folder, make sure you are uploading Webfonts, you can generate Webfont files here 2)Then add @font-face in Theme Option &gt; Advacned &gt; Custom CSS this way: @font-face {font-family: &#8216;Gruppo&#8217;;src: url(&#8216;\/wp-content\/uploads\/fonts\/Gruppo_reg.eot&#8217;);src: url(&#8216;\/wp-content\/uploads\/fonts\/Gruppo_reg.eot&#8217;) format(&#8217;embedded-opentype&#8217;),url(&#8216;\/wp-content\/uploads\/fonts\/Gruppo_reg.woff&#8217;) format(&#8216;woff&#8217;),url(&#8216;\/wp-content\/uploads\/fonts\/Gruppo_reg.ttf&#8217;) format(&#8216;truetype&#8217;),url(&#8216;\/wp-content\/uploads\/fonts\/gruppo_reg.svg#Gruppo&#8217;) format(&#8216;svg&#8217;);} 3) Add&hellip;<\/p>\n","protected":false},"author":2,"featured_media":4470,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[30,31],"tags":[],"class_list":["post-4132","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dream-theme-support-portal","category-knowledgebase","category-30","category-31","description-off"],"acf":[],"_links":{"self":[{"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/posts\/4132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/comments?post=4132"}],"version-history":[{"count":1,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/posts\/4132\/revisions"}],"predecessor-version":[{"id":4233,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/posts\/4132\/revisions\/4233"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/media\/4470"}],"wp:attachment":[{"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/media?parent=4132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/categories?post=4132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/tags?post=4132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}