Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1464721

    Hi, I have a custom font that loads on Chrome for my headers and menu elements but does not load on Safari or Firefox. The font is loading from Adobe type kit. I cannot add the font via the font uploader seeing it is from adobe typekit. I added the code in my functions.php in private which works on chrome but not safari.

    #1464747

    Hey spokerstradingco,

    Thank you for the inquiry.

    We adjusted the filters a bit. Please try it again:

    /* Adobe Typekit font */
    add_action('init', 'enfold_customization_switch_fonts');
    function enfold_customization_switch_fonts() {
        global $avia;
        $avia->style->print_extra_output = false;
    }
    
    add_filter('avf_google_heading_font', 'avia_add_heading_font');
    function avia_add_heading_font($fonts) {
        $fonts['Espiritu Regular'] = 'espiritu';
        return $fonts;
    }
    
    add_filter('avf_google_content_font', 'avia_add_content_font');
    function avia_add_content_font($fonts) {
        $fonts['Espiritu Regular'] = 'espiritu';
        return $fonts;
    }
    
    add_action('wp_head', 'enfold_customization_add_scripts');
    function enfold_customization_add_scripts() {
        ?>
        <link rel="stylesheet" href="https://use.typekit.net/rww4dia.css">
        <?php
    }
    
    

    Best regards,
    Ismael

    #1464793

    Hi, The font is still not loading on Safari after adding the new code.

    #1464872

    Hi,

    Thank you for the update.

    You may need to toggle or temporarily disable the Enfold > Performance > File Compression settings and purge the cache. Let us know the result.

    Best regards,
    Ismael

    #1464882

    Or perhaps your security settings (htacces file, etc.) prevent you from using URLs other than those of your own domain. So loading from https://use.typekit.net/rww4dia.css is not allowed.

    #1464936

    Hi, I disabled the css and javascript and cleared the cache but the problem persists. It looks like the font is also not loading on chrome anymore… Perhaps the new code you provided?

    #1464938

    it is this snippet:

    add_action('wp_head', 'enfold_customization_add_scripts');
    function enfold_customization_add_scripts() {
        ?>
        <link rel="stylesheet" href="https://use.typekit.net/rww4dia.css">
        <?php
    }

    that my comment is for. On my htaccess file i do not allow loading from different sources than my own domain.
    If i would place such a snippet – it will not be loaded – allthough the snippet might be correct.

    if that is not the reason for not loading – try to enqueue that css file:

    function enqueue_external_css() {
       wp_enqueue_style( 'adobe_typekit', 'https://use.typekit.net/rww4dia.css' );
    }
    add_action( 'wp_enqueue_scripts', 'enqueue_external_css', 20 );

    _______________

    i do not know if your first snippet do run with newest enfold. This code snippet has been valid for half an eternity.
    For my installations i use now instead:

    function my_output_google_webfonts_script( $activate ){
      return false;
    }
    add_filter( 'avf_output_google_webfonts_script', 'my_output_google_webfonts_script', 10, 1 );
    #1464945

    Hi,

    Have you tried reselecting the font? We may need to access the site to properly check the issue. Please provide the login details in the private field.

    Best regards,
    Ismael

    #1465002

    Credentials attached in private

    #1465016

    Hi,

    Thank you for the info.

    The custom font was not selected as the heading and body font in Enfold > General Styling > Fonts tag. We re-selected it as the default font. Please make sure to purge the cache before checking.

    Best regards,
    Ismael

    #1465017

    Hi,

    UPDATE: Also, when checking on Safari, please make sure to clear the browser history, as Safari tends to cache older versions of websites.

    Best regards,
    Ismael

    #1465093

    can you please give a feedback – how you solved it ;)

    #1465116

    Thank you. It looks like the font is showing up now. It does look a little thicker than it was originally but that is ok. Because the font is thicker the lines between the menu items is off place. Can I get some code to fix the small lines between the menu items?I believe I was already given some code that is in the quick css. I included a screesnshot

    #1465130

    Well – if you open your linked css:
    https://use.typekit.net/rww4dia.css

    you see what it does: there is the @import url rule – and : font-family:”espiritu”

    if you look deeper to that css – you see that you can download those files via those urls ( even as otf)

    @font-face {
    font-family:"espiritu";
    src:
    url("https://use.typekit.net/af/cb2cbd/00000000000000007736dd40/30/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3") format("woff2"),
    url("https://use.typekit.net/af/cb2cbd/00000000000000007736dd40/30/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3") format("woff"),
    url("https://use.typekit.net/af/cb2cbd/00000000000000007736dd40/30/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3") format("opentype");
    font-display:auto;
    font-style:normal;
    font-weight:400;
    font-stretch:normal;
    }
    

    you only have to give the downloaded files a meaningfull name and the correct file extension ;)

    so maybe you host those fonts on your own server.

    #1465143

    Hi,

    Can I get some code to fix the small lines between the menu items?

    To change the position of the lines, try to adjust the value of the top property in this css code.

    .av_seperator_small_border .av-main-nav > li > a > .avia-menu-text:before {
        content: '';
        width: 2px;
        height: 32px;
        background: #c4beb1;
        display: block;
        position: absolute;
        left: 0;
        top: 48%;
        transform: translateY(-50%);
    }

    The previous value was 58%.

    Best regards,
    Ismael

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.