diff --git a/customizer.php b/customizer.php index d559096..878f105 100644 --- a/customizer.php +++ b/customizer.php @@ -283,11 +283,6 @@ public function theme_font_customizer( $wp_customize ) { } - } - - if( !$has_panel ){ - $this->display_inputs( $theme_font_locations, $wp_customize ); - } else{ $wp_customize->add_setting( 'show_advanced_fonts', array( 'transport' => 'postMessage' ) @@ -301,6 +296,11 @@ public function theme_font_customizer( $wp_customize ) { 'section' => 'theme_fonts_main', ) ); + + } + + if( !$has_panel ){ + $this->display_inputs( $theme_font_locations, $wp_customize ); } } @@ -351,7 +351,7 @@ public function display_inputs( $font_locations, $wp_customize, $section = 'main $default = array( '' => 'Select a Font', - $font_location['default'] => $font_location['default'] . ' (default)', + $font_location['default'] => !empty( $font_location['default_title'] ) ? $font_location['default_title'] : sprintf( esc_html__( '%s (default)', 'typecase' ), $font_location['default'] ), ); $wp_customize->add_control( @@ -477,4 +477,4 @@ public function customizer_live_preview(){ } -$typecase_customizer = Typecase_Customizer::init(); \ No newline at end of file +$typecase_customizer = Typecase_Customizer::init(); diff --git a/typecase.php b/typecase.php index 85c20ec..3e1aaef 100644 --- a/typecase.php +++ b/typecase.php @@ -456,6 +456,11 @@ public function display_frontend(){ $import_url .= '|'; $import_url .= str_replace(" ","+",$family).$this->stringify_font_part($weights).$this->stringify_font_part($charsets); + + // Skip font styles if no selectors are defined + if ( empty( $selectors ) ) { + continue; + } $selectors = explode("|",$selectors);