Pro - Customize vs Theme Options and font issues

In Pro, 90% of the time, if I go to Appearance > Customize then the browser crashes (Chrome crashed nearly all the time, Firefox seems OK). If I do manage to get in then the settings are different from Pro > Theme Options.

The issue I have is that under Appearance > Customize there are fonts loaded that I am not using. i.e. logo font, navbar font etc. So even though I am using the header builder these fonts are added into the head of my HTML.

I am using the template manager and Pro then loads the fonts into the footer of the HTML page. As such it is calling “Open Sans” twice, once in the head, once at the bottom of the page. It also loads Lato as that is set as the logo and navbar font in Customise.

At the moment I have Open Sans & Lato loading based on Customize settings and Open Sans & Droid Serif loading due to font template manager.

Any idea how to prevent the fonts etc. set in Customize section from loading when using the header builder and font templates?

At the very least any idea how to prevent the same font loading twice?

ie. in my HTML head
<link rel='stylesheet' id='x-google-fonts-css' href='//fonts.googleapis.com/css?family=Open+Sans%3A300%2C300italic%2C700%2C700italic%7CLato%3A700&#038;subset=latin%2Clatin-ext&#038;ver=1.2.7' type='text/css' media='all' />

and in the bottom of the page.
<link rel='stylesheet' id='cs-google-fonts-css' href='//fonts.googleapis.com/css?family=Open+Sans%3A300%2C300i%2C700&#038;ver=2.1.7#038;subset=latin,latin-ext' type='text/css' media='all' />

Hi There,

Thanks for writing in!

We are really sorry that you are facing such issue in Pro.
Please provide us your website URL and login details in a secure note so that we can investigate the issue for you and give you a proper solution.

Thanks

I have added a secure note.

Hi there,

The first font is a fallback font just in case there is no defined font to make it looks the same, and it’s usually part of the theme. The second one is loaded with cornerstone options. And it should be normal and okay, but if you insist on removing the first one, then please add this code to your child theme’s functions.php

  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 = '';
    }



    //
    // Enqueue styles.
    //

    wp_enqueue_style( 'x-stack', X_TEMPLATE_URL . '/framework/css/dist/site/stacks/' . $stack . $ext . '.css', NULL, X_ASSET_REV, 'all' );

    do_action( 'x_enqueue_styles' );

    if ( is_child_theme() && apply_filters( 'x_enqueue_parent_stylesheet', false ) ) {
      $rev = ( defined( 'X_CHILD_ASSET_REV' ) ) ? X_CHILD_ASSET_REV : X_ASSET_REV;
      wp_enqueue_style( 'x-child', get_stylesheet_directory_uri() . '/style.css', array(), $rev, 'all' );
    }

    if ( is_rtl() ) {
      wp_enqueue_style( 'x-rtl', X_TEMPLATE_URL . '/framework/css/dist/site/rtl/' . $stack . '.css', NULL, X_ASSET_REV, '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_ASSET_REV, '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_ASSET_REV, '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_ASSET_REV, '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_ASSET_REV, 'all' );
    }

    if ( X_CONTACT_FORM_7_IS_ACTIVE ) {
      wp_deregister_style( 'contact-form-7' );
    }

   // no more X Google fonts
   // x_enqueue_google_fonts(); 

  }

Make sure to purge and clean your caches before testing.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.