Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Problem with H&FJ cloud fonts in WordPress

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #151646
    John Nolan
    Participant

    I’m having a problem getting H&FJ’s cloud fonts to work consistently on my blog:
    http://www.ragandbone.ca/wp/index.php

    Sometimes they work, sometime they don’t. Sometimes I see them in Chrome, but if I then load the page into Safari they’re gone, or vice-versa.

    A validation check shows 403 errors for the font files, but I think that’s due to the protected nature of the font resources. (This site shows the same error, and so does H&F’s own site.

    I contacted H&FJ, but haven’t received any real pointers except to say that I needed to put their code in the head. Hmm…

    In general, the fonts are unreliable…any ideas where I’m going wrong?

    #151887
    John Nolan
    Participant

    Just to follow up:

    I got help from H&FJ. They said:
    “It sounds like there may be an issue related to the project’s domain list, so if it’s not too much trouble I’d like you to add your domain as a wildcard (“*.ragandbone.ca”) through your Cloud dashboard, which will allow webfonts to render across all subdomains.”

    That seems to have solved my problems.

    #151928
    chrisburton
    Participant

    Works for me too but your type choices are a bit all over the place.

    #151940
    John Nolan
    Participant

    Well, I was leaving old choices in place until I got the fonts working consistently.

    #152003
    chrisburton
    Participant

    Oh, I see. Glad you figured it out.

    #157268
    mgauthier15
    Participant

    Just found this thread as I am encountering the same problem.

    John – which file did you paste the code they supplied into? Was it as simple as pasting their code? Or did you have to modify the function.php file in your child theme?

    Also, how do you add your domain as a wildcard through their service? So far, H&FJ hasn’t been so helpful (as I’m sure you have encountered).

    Many thanks in advance for any help you can give!

    #157273
    John Nolan
    Participant

    I added the code to the function.php of the theme parent, and then also added a function.php file to the child theme, editing some other code I found. I don’t know if both were necessary, I was just trying whatever I could think of. (And I really have very little idea what I was doing!)

    The child theme’s function.php, in it’s entirety, is:

    <?php
    add_action( 'genesis_meta', 'wpb_add_google_fonts', 5);

    function wpb_add_google_fonts() {
    echo '’;
    }

    (replace the “###” with your H&fJ numbers)

    Obviously I could/should have renamed the function, but I never thought anyone else would be looking!

    I even tried writing a plugin:

    But I think the main thing is the wildcard domain. Add a new domain to your project: *.yourdomain.com

    That should do it!

    #157278
    mgauthier15
    Participant
    <?php add_action( 'genesis_meta', 'wpb_add_google_fonts', 5);
    
    function wpb_add_google_fonts() { echo '’; }
    
    (replace the “###” with your H&fJ numbers)
    

    By ### do you mean the “5”?

    So you used a combination of google and H&FJ fonts? Where is the url for the php file to reference your font library on their server?

    Thanks so much for your help!

    #157292
    John Nolan
    Participant

    Hmmm… I see that my post didn’t come through entirely (some of the code is missing.)

    No, I just reused a bit of code that was originally used to load google fonts, but I didn’t re-name the function in the code. It doesn’t really matter what the function is called.

    I’ll try again. The child theme’s function.php, in it’s entirety, is:

    <?php
    add_action( ‘genesis_meta’, ‘add_hfj_fonts’, 5);

    function add_hfj_fonts() {
    echo ‘place_hfj_css_key_here” />’;
    }

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