1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 custom font not working after upgrade

Discussion in 'XenForo Questions and Support' started by Nobitakung, Mar 19, 2016.

  1. Nobitakung

    Nobitakung Member

    Hi, I use custom fonts in several parts of my site by adding @font css rules in the EXTRA.CSS, but after upgrading from 1.5.0 to 1.5.6 , those fonts are no longer applied to the html elements. What happen?
  2. wang

    wang Well-Known Member

    Is the code still in the EXTRA.CSS file? Was that the only place where you have added your custom code or in other parts too?
  3. Nobitakung

    Nobitakung Member

    Yes, it's still there.

    I've made some other modification in other templates but it's nothing to do with the fonts. All font related modification is just in EXTRA.CSS
  4. Arty

    Arty Well-Known Member

    If files for those fonts are hosted on your server, check they are still there. Maybe you've accidentally deleted them.

    Or maybe you've edited some style properties, which got overwritten during update, but forgot about them.
  5. ARad

    ARad Member

    Search up @fa_primaryfont and change your font style there
  6. Nobitakung

    Nobitakung Member

    Thank you to all of you. I've found the cause of the issue finally, it's about that the .htaccess was replaced during upgrade, so the code that redirect the www version to non-www version which I've added in the original .htaccess is no longer exist there. And I happened to use absolute font url in @font-face rules, that is I point it to http://mysite.com/fonts/...... and when I access the site with http://www.mysite.com the fonts seem to not loaded. So, this problem can be fixed by changing the @font-face to use relative font url , like "./fonts/...." or add the missing redirect code in the .htaccess file.

    But, I still wonder why in www version and the browser have problem in loading the font file in non-www version? I'd appreciate if anyone will kindly explain this. Thanks.

Share This Page