Tagged: x
-
AuthorPosts
-
March 15, 2017 at 9:38 am #1408049
dthomParticipantHi. I have read the discussion posts on how to remove google fonts – I seem to have most if not all on my site (mysalus.org) and am trying to optimize the site for speed as I am only using standard x fonts. I was running Revolution slider a year ago and remember playing with fonts. I have since removed revolution slider and do not plan on using it again. Also, I am running Essential Grid but do not see that it is calling the long list fo google fonts that I am seeing.
I have a google web fonts line item under settings in my admin panel which shows the attached screenshot. I can’t recollect if this may have been added via a plugin that I have since deleted (just trying to figure out how to get rid of it – and the numerous loaded fonts.
Per other discussions, I have added the following code to my child theme fonts but they don’t seem to make a difference as my Typology in customizer still shows around 80 or so web-fonts. I want to preserve the default integrity fonts. Other ideas how to address this? THANKS!
/* X THEME REMOVE GOOGLE FONTS */
add_action( ‘wp_print_styles’, ‘my_deregister_styles’, 100 );
function my_deregister_styles() {
wp_deregister_style( ‘x-google-fonts’ );
}function x_enqueue_site_styles() {
//
// Stack data.
//$stack = x_get_stack();
$design = x_get_option( ‘x_integrity_design’ );if ( $stack == ‘integrity’ && $design == ‘light’ ) {
$ext = ‘-light’;
} elseif ( $stack == ‘integrity’ && $design == ‘dark’ ) {
$ext = ‘-dark’;
} else {
$ext = ”;
}//
// Register styles.
//wp_register_style( ‘x-stack’, X_TEMPLATE_URL . ‘/framework/css/dist/site/stacks/’ . $stack . $ext . ‘.css’, NULL, X_VERSION, ‘all’ );
//
// Enqueue styles.
//if ( is_child_theme() ) {
$dep = ( apply_filters( ‘x_enqueue_parent_stylesheet’, false ) ) ? array( ‘x-stack’ ) : NULL;
wp_enqueue_style( ‘x-child’, get_stylesheet_directory_uri() . ‘/style.css’, $dep, X_VERSION, ‘all’ );
} else {
wp_enqueue_style( ‘x-stack’ );
}if ( is_rtl() ) {
wp_enqueue_style( ‘x-rtl’, X_TEMPLATE_URL . ‘/framework/css/dist/site/rtl/’ . $stack . ‘.css’, NULL, X_VERSION, ‘all’ );
}if ( X_BBPRESS_IS_ACTIVE ) {
if ( x_is_bbpress() ) {
wp_deregister_style( ‘buttons’ );
}
wp_deregister_style( ‘bbp-default’ );
wp_enqueue_style( ‘x-bbpress’, X_TEMPLATE_URL . ‘/framework/css/dist/site/bbpress/’ . $stack . $ext . ‘.css’, NULL, X_VERSION, ‘all’ );
}if ( X_BUDDYPRESS_IS_ACTIVE ) {
wp_deregister_style( ‘bp-legacy-css’ );
wp_deregister_style( ‘bp-admin-bar’ );
wp_enqueue_style( ‘x-buddypress’, X_TEMPLATE_URL . ‘/framework/css/dist/site/buddypress/’ . $stack . $ext . ‘.css’, NULL, X_VERSION, ‘all’ );
}if ( X_WOOCOMMERCE_IS_ACTIVE ) {
wp_deregister_style( ‘woocommerce-layout’ );
wp_deregister_style( ‘woocommerce-general’ );
wp_deregister_style( ‘woocommerce-smallscreen’ );
wp_enqueue_style( ‘x-woocommerce’, X_TEMPLATE_URL . ‘/framework/css/dist/site/woocommerce/’ . $stack . $ext . ‘.css’, NULL, X_VERSION, ‘all’ );
}if ( X_GRAVITY_FORMS_IS_ACTIVE ) {
wp_enqueue_style( ‘x-gravity-forms’, X_TEMPLATE_URL . ‘/framework/css/dist/site/gravity_forms/’ . $stack . $ext . ‘.css’, NULL, X_VERSION, ‘all’ );
}if ( X_CONTACT_FORM_7_IS_ACTIVE ) {
wp_deregister_style( ‘contact-form-7’ );
}}
March 15, 2017 at 10:55 am #1408185
ThaiModeratorHi There,
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thanks.
March 15, 2017 at 11:50 am #1408284
dthomParticipantThis reply has been marked as private.March 15, 2017 at 2:27 pm #1408487
JadeModeratorHI there,
Kindly provide us with your FTP details as well so that we can check it further.
Thank you.
March 15, 2017 at 2:57 pm #1408519
dthomParticipantThis reply has been marked as private.March 15, 2017 at 11:49 pm #1409121
Rue NelModeratorHello There,
Thanks for providing the information. The code in your child theme’s functions.php file will only deregister the Google Fonts however, the google fonts will still display in the customizer’s typography because those fonts were hardcoded in the a list file along with the default System fonts. You can remove it from the customizer. Doing so would mean modifying the list file which we do not recommend. You do not have to worry because as long as you did not select any Google font in the customizer and will only use system fonts, Google fonts will not loaded in the front end. Unless otherwise a certain plugin like Essential Grid will load a Google font.
Hope this helps.
March 16, 2017 at 6:38 am #1409450
dthomParticipantOK. Is this how it should be with X? Having all of the fonts show under settings and in the customizer? Also if I should leave as is should I then clean up my child theme and remove the code deregistering google fonts – as it didn’t seem to make any difference?
Thanks
March 16, 2017 at 9:06 am #1409598
RupokMemberHi there,
If you deregister the fonts then it should not load in site. So having them in Customizer should not hurt you anyway.
Thanks!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1408049 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
