Home User profile
tagDiv Member
This user did not write anything. So we are just showing here some random text to make the profile page look nice :)
nucreative
tagDiv Member

Ok, after much fiddling around, I have managed to get it to work on my own. The solution seems to be:

When you come back to wp-admin/admin.php?page=td_theme_panel, you have to open the Theme Fonts section, then also open one of the sub-sections (Header, Modules and Blocks General, etc), then click the ‘SAVE SETTINGS’ button.

I can’t verify this to be the actual cause of the fix (I don’t have time to faff about with it any longer) but it seems to have worked on this occasion.

nucreative
tagDiv Member

Hi Bogdan. We have been through this before on the same site: https://forum.tagdiv.com/topic/cant-remove-myfonts-com-preview-bar-from-top-of-window/

I can give you login information to fix the problem yourselves again, but I would prefer to have a solution I can implement myself, in case it happens again.

The last time we went through this by email, the solution was apparently to “clear the font buffer” – although I don’t think there is an option to do this through the UI, so it might just be something that the devs do whenever this happens. Do you know what this means, and can we do it ourselves?

nucreative
tagDiv Member

Hi Bogdan,

We don’t have a caching plugin or a CDN. We do have Jetpack, but we don’t have Photon switched on.

And besides, the CSS for the fonts gets output in the html file itself as a <style> tag – this is just below a comment: <!– Header style compiled by theme –>

So it’s not an external CSS file, and it shouldn’t be cached.

I have also cleared my browser cache, but that hasn’t fixed it.

nucreative
tagDiv Member

Actually, it sometimes doesn’t work.

I change the “Custom font files” on this page: http://wow-staging.nucreativetesting.co.uk/wp/wp-admin/admin.php?page=td_theme_panel&td_page=td_view_custom_fonts

…and then “SAVE SETTINGS” on this page: http://wow-staging.nucreativetesting.co.uk/wp/wp-admin/admin.php?page=td_theme_panel

…and then empty the cache, and reload the page. But the theme still tries to load the fonts from the old location.

I think the theme is caching the old values. How can I fix this?

nucreative
tagDiv Member

Hi Alin, thanks for your reply, and for the custom CSS. Using the CSS would hide the problem, but it would be better if we could get rid of this javascript code completely.

I understand we’re not required to add anything to the Typekit section. And, admittedly, we probably shouldn’t have put Myfonts code in there either. But it’s happened now. And now that javascript is in the database and being injected into the page (<!– JS generated by theme –>)

What we want to do now is remove that code. We’ve tried overwriting the contents of the Typekit box with <script></script> (http://i64.tinypic.com/28tb6gx.jpg), but we still get the same Myfonts code being injected.

By the way, I have searched all of our theme files – we definitely haven’t hardcoded this into our child theme. It must be coming from the database.

I seem to have no option but to edit the database directly – unless you can help me figure out a way to remove it via the theme settings.

nucreative
tagDiv Member

Hi Alin, thanks for your reply.

Yes, I appreciate that this preview bar is not a direct result of the Newspaper6 theme. However, I think you might still be able to help us.

I think we have somehow changed one of the theme settings, and this is what is injecting the Myfonts code into the page.

If you view the source of http://79.170.40.247/wellbeingofwomen.org.uk/ and search for ‘myfonts’ you will find this section:


<!-- JS generated by theme -->

...

<script type="text/javascript">
(function() {
var path = '//easy.myfonts.net/v2/js?sid=250385(font-family=Geometria+Bold)&sid=250387(font-family=Geometria+ExtraLight)&sid=250395(font-family=Geometria+Medium)&sid=250397(font-family=Geometria)&key=Kiee4jHq8u',
protocol = ('https:' == document.location.protocol ? 'https:' : 'http:'),
trial = document.createElement('script');
trial.type = 'text/javascript';
trial.async = true;
trial.src = protocol + path;
var head = document.getElementsByTagName("head")[0];
head.appendChild(trial);
})();
</script>
<!-- Header style compiled by theme -->

If I search a mysql dump of our database, I can also find this data:


INSERT INTO
wowwp_options VALUES (

...

(607,'td_011','a:271:{s:15:\"tds_logo_upload\";s:94:\"http://79.170.40.247/wellbeingofwomen.org.uk/wp-content/uploads/2016/01/WoW_horizontal-500.png\";s:13:

...

var path = \\\'//easy.myfonts.net/v2/js?sid=250385(font-family=Geometria+Bold)&sid=250387(font-family=Geometria+ExtraLight)&sid=250395(font-family=Geometria+Medium)&sid=250397(font-family=Geometria)&key=Kiee4jHq8u\\\'

So it appears that the source of the myfonts code within the “JS generated by theme” is one of the entries in the wp_options table.

I suspect the way it got there was via this panel in Theme Panel > Theme Fonts > Custom Fonts:
http://i64.tinypic.com/28tb6gx.jpg

We originally had the myfonts code pasted in here. We’ve tried to overwrite it with a simple empty script tag, but this doesn’t seem to have worked.

Can you help us to fix this?

nucreative
tagDiv Member

The first thing that springs to mind, is that we are using the child theme (as we plan to make customisations). Could this be the reason that those lines in functions.php are not taking effect?

Edited to add: we have not yet made any code changes at all – this is a fresh install.

nucreative
tagDiv Member

We used the Visual Composer version that came with the theme download. ‘Post Grid’ is one of the available options in the editor. So it seems that some incompatible options have not yet been removed from Visual Composer.

Viewing 8 posts - 1 through 8 (of 8 total)