-
AuthorPosts
-
March 22, 2016 at 1:23 pm #601848
Hello guys,
I’m using Enfold with Lato google font and I’d like to add latin-extended subset.
I found similar topic ( https://kriesi.at/support/topic/google-fotns-with-extended-latin-subset/ ) and I tried applying the same solution, but no luck.
add_filter( 'avf_google_heading_font', 'avia_add_heading_font'); function avia_add_heading_font($fonts) { $fonts['Lato'] = 'Lato:400,300,300italic,400italic,700,900:latin,latin-ext'; return $fonts; } add_filter( 'avf_google_content_font', 'avia_add_content_font'); function avia_add_content_font($fonts) { $fonts['Lato'] = 'Lato:400,300,300italic,400italic,700,900:latin,latin-ext'; return $fonts; }
I added this chunk to child-theme’s function.php, but nothing happened. Then I moved it to enfold function.php right after
$avia_config['color_sets'] = array( 'header_color' => 'Logo Area', 'main_color' => 'Main Content', 'alternate_color' => 'Alternate Content', 'footer_color' => 'Footer', 'socket_color' => 'Socket' );
and the app was broken – I got the following error:
Fatal error: Cannot redeclare avia_add_heading_font() (previously declared in /home/acirs/public_html/content/themes/ACI/functions.php:9) in /home/acirs/public_html/content/themes/enfold/functions.php on line 54
What am I doing wrong? :)- This topic was modified 8 years, 9 months ago by borkosavic.
March 22, 2016 at 4:18 pm #601948Hey borkosavic!
Please change your code to following one
add_filter( 'avf_google_heading_font', 'avia_new_add_heading_font'); function avia_new_add_heading_font($fonts) { $fonts['Lato'] = 'Lato:400,300,300italic,400italic,700,900:latin,latin-ext'; return $fonts; } add_filter( 'avf_google_content_font', 'avia_new_add_content_font'); function avia_new_add_content_font($fonts) { $fonts['Lato'] = 'Lato:400,300,300italic,400italic,700,900:latin,latin-ext'; return $fonts; }
You cannot declare the same function twice changing the function name should fix the error
Best regards,
YigitMarch 22, 2016 at 5:43 pm #602032No luck – extra characters are still being shown differently
March 22, 2016 at 5:45 pm #602035Hi!
Can you please try adding following code to Functions.php file as well
function add_subset_func($fontlist) { $fontlist .= "&subset=latin,latin-ext"; return $fontlist; } add_filter('avf_google_fontlist', 'add_subset_func');
Best regards,
YigitMarch 22, 2016 at 8:45 pm #602105This is my child-theme functions.php:
<?php /* * Add your own functions here. You can also copy some of the theme functions into this file. * WordPress will use those functions instead of the original functions then. */ add_filter( 'avf_google_heading_font', 'avia_new_add_heading_font'); function avia_new_add_heading_font($fonts) { $fonts['Lato'] = 'Lato:400,300,300italic,400italic,700,900:latin,latin-ext'; return $fonts; } add_filter( 'avf_google_content_font', 'avia_new_add_content_font'); function avia_new_add_content_font($fonts) { $fonts['Lato'] = 'Lato:400,300,300italic,400italic,700,900:latin,latin-ext'; return $fonts; } function add_subset_func($fontlist) { $fontlist .= "&subset=latin,latin-ext"; return $fontlist; } add_filter('avf_google_fontlist', 'add_subset_func');
Still no luck
March 23, 2016 at 8:32 am #602384 -
AuthorPosts
- You must be logged in to reply to this topic.