Support » Theme: Aaron » Theme doesn’t keep new fonts set in customiser

  • Resolved francisbarton

    (@francisbarton)


    Hi Carolina
    I am running a child theme based on Aaron 3.5. I have currently turned off all child styles declarations.
    My problem is that the fonts I am selecting via the Customiser are not staying set. They keep reverting to the defaults (Open Sans and Montserrat). I have used Aaron for a year or so, and not had this problem before.

    Here’s what I do:
    1. From Dashboard, select Appearance > Customise
    2. In Customiser, select Typography
    3. Choose “Source Sans Pro” for font in both settings
    4. Click Publish
    5. Click X to return to site

    I find that the fonts on the site are unchanged from the defaults, even after refreshing the page. When I go back into the Customiser again, the defaults are once again selected in the Typography settings. My changes have not been kept.

    I have just switched my site back to Aaron itself, not my child theme, and the problem is the same. Any ideas?

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Theme Author Carolina Nymark

    (@poena)

    Hi
    Thank you for reporting this, I will do some testing to see if I can reproduce it.
    Besides refreshing the page, have you tried clearing the cache?

    francisbarton

    (@francisbarton)

    I’ve cleared the cache now and tested it again; still the same issue.

    As I’m running a child theme, I can easily do a workaround to this by setting the fonts in my CSS, but the issue is there, still. I can’t think at the moment where the variables set by the Customiser would be stored? There must be a file somewhere in the theme folder that documents the customiser outputs. I could have a look and see what is there.
    Other changes that I make in the Customiser are being successfully retained; it seems to be just the fonts that are not being changed. Maybe something wrong with my Google fonts set up? But surely Aaron would override this.

    francisbarton

    (@francisbarton)

    Hmmm, the customiser settings seem to be in the <head> of the page, so according to Firefox Dev Tools as inline styles they are overriding my child theme CSS.

    Also in the <head> there are these two lines – is this right?

    <link rel='stylesheet' id='aaron-fonts-css'  href='//fonts.googleapis.com/css?family=Montserrat%7COpen%20Sans&subset=latin%2Clatin-ext' type='text/css' media='all' />
    <link rel='stylesheet' id='open-sans-css'  href='https://fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&subset=latin%2Clatin-ext&ver=4.9.8' type='text/css' media='all' />
    Theme Author Carolina Nymark

    (@poena)

    Hi

    I have not had a chance to test yet. But if the option is not saving it is probably something wrong with the new sanitize callback.

    francisbarton

    (@francisbarton)

    Thank you – I appreciate you are doing this in your own time.

    francisbarton

    (@francisbarton)

    Here’s the order things live in my <head> (edited for simplicity):

    <link rel='stylesheet' parent style (Aaron) />
    <link rel='stylesheet' child style (mine) />
    <link rel='stylesheet' id='aaron-fonts-css' (Montserrat) />
    <link rel='stylesheet' id='open-sans-css'  (Open Sans) />
    <javascript, meta tags, link rels etc etc>
    <style type="text/css">customiser settings</style>

    I am wondering, if I can make my child stylesheet link come after the <style> tag, would that make any difference? I tried to find out from here: https://css-tricks.com/precedence-css-order-css-matters/ – I think the answer is yes, but I still wasn’t sure if this is something that is worth trying to achieve.

    Theme Author Carolina Nymark

    (@poena)

    I dont see the point of overwriting all the customizer settings with the child theme styles.

    “The additional css” option in the customizer should come last.

    Theme Author Carolina Nymark

    (@poena)

    Hi,
    this should be fixed with version 3.6 that I just uploaded.
    -I had used a sanitize callback that was too strict and did not allow the spaces that are used in some of the font names.

    francisbarton

    (@francisbarton)

    Thanks Carolina – yes it’s fixed here now: customiser is keeping the typography options as set.
    Of course you’re right about the CSS order – I was just thinking in my own bubble about how to work around the issue. I prefer to put everything in a child theme CSS rather than use the “additional CSS” feature, and I don’t like settings in the page header (that I can’t easily affect) over-riding my child theme external CSS file. But of course it has to be that way.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Theme doesn’t keep new fonts set in customiser’ is closed to new replies.