Viewing 1 replies (of 1 total)
  • Darkspire Media

    (@drewmturner)

    I have the same issue. It’s enqueuing web safe fonts and causing a 404.

    In functions.php, I updated this function to remove all web safe fonts from enqueue.

    function acfgfs_get_fonts_to_enqueue() {
         $web_safe = acfgfs_get_web_safe_fonts();
         if( is_singular() ) {
             global $post;
             $post_fields = get_field_objects( $post->ID );
         }
         $post_fields = ( empty( $post_fields ) ) ? array() : $post_fields;
         $option_fields = get_field_objects( 'options' );
         $option_fields = ( empty( $option_fields ) ) ? array() : $option_fields;
         $fields = array_merge( $post_fields, $option_fields );
         $font_fields = array();
         foreach( $fields as $field ) {
             if( !empty( $field['type'] ) && 'google_font_selector' == $field['type'] && !empty( $field['value'] ) && !in_array($field['value']['font'],$web_safe) ) {
                 $font_fields[] = $field['value'];
             }
         }
    
         $font_fields = apply_filters( 'acfgfs/enqueued_fonts', $font_fields );
    
         return $font_fields;
     }

    Hopefully the plugin author will fix this in the next release.

Viewing 1 replies (of 1 total)
  • The topic ‘Loads web safe font as google font’ is closed to new replies.