Unwanted fonts loading

Posted in: Newspaper
Post count: 39

Hi,

I’ve decided to use a custom web safe font stack and edited td_fonts.php to add the new fonts, then replaced every instance of non web safe fonts in style.css. Also I’ve made sure that no google fonts, or type kit fonts are shown, and all the theme panel > Custom typography fonts are set to default.

When the web page is loaded all the titles etc are the web safe, however in the source code the old fonts are still being called:

<link rel=’stylesheet’ id=’google-font-rest-css’ href=’http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic|Ubuntu:400,400italic|Open+Sans:400italic,400|Oswald:400,700|Roboto+Condensed:400italic,700italic,400,700?ver=4.2′ type=’text/css’ media=’all’ />

I’m not using a caching plugin, and the browsers are not loading a cached version yet this still happens. Do you know where this stylesheet is being loaded from? And is there anyway to prevent it from being loaded it?

Many thanks for any advice!

Post count: 9544

Hi
I think you need to comment out the section in functions.php which calls the Google fonts. Simply put // at start of each line for the Google fonts section 🙂

Post count: 39

Hi Christopher,

Excellent! Many Thanks

Post count: 9544

I did pretty much the same thing; basically using the Gill Sans stack; and simply replaced the stacks in style.css. I didn’t need to change the loop files, since I think those call the “default” font, so if you change that in styles.css I think all you need to tweak each time the theme is updated is just functions.php and styles.css and leave rest alone (unless I’m wrong … ) 😉

Post count: 39

Having problems commenting out some of the fonts in the functions.php – seems to freeze the interface, looks they’re used by the admin theme panel. Will keep persevering.

Wish they’d just stick to arial for the interface, and then enque the fonts selected by the user via the theme – would make things much simpler

Post count: 9544

I think the admin panel uses the default fonts of WordPress which are now Open Sans. You should be able to just delete the one block having to do with writing the google fonts into the head of the document, which have nothing to do with the admin interface fonts.

Hmmm….. v4 changed some stuff for more loops ….. hm…..

try only commenting out line 48 in functions.php

// wp_enqueue_style('google-font-rest', td_global::$http_or_https . '://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic|Ubuntu:400,400italic|Open+Sans:400italic,400|Oswald:400,700|Roboto+Condensed:400italic,700italic,400,700'); //used on menus/small text

Post count: 39

That seems to have worked! Thanks so much for working this out, very appreciated

Post count: 9544

I have to remember how to do this each time I upgrade the theme, and so it wasn’t top of mind first time I looked at it. Had to “retrain my brain” on what I did last time 🙂

Glad I could help !

(and again – I don’t work here; just helping out to pay forward all the help I’ve gotten from others over the years — my thoughts, ideas, and suggestions do NOT represent TagDiv folk … )

Viewing 8 posts - 1 through 8 (of 8 total)
The forum ‘Newspaper’ is closed to new topics and replies.