Home Forums Product Support Novella Hardcoding the font scripts?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #18773
    GG2 Admin
    Participant

    Hello ASE – Is there a reason why this (below) is in the header.php? Why aren’t these done using enqueu? Or put them in another .php and use get_template_part to include them. This way it’s easier to modify – because as it is, it’s done via a worst practice, not a best 😉

    Long to short, having to create a child theme and replacate the whole of header.php just to change the fonts is kinda disappointing 🙂

    <link href='//fonts.googleapis.com/css?family=Libre+Baskerville:400,700,400italic' rel='stylesheet' type='text/css'>
    <link href='//fonts.googleapis.com/css?family=Lato:300,400,700,900,400italic' rel='stylesheet' type='text/css'>

    p.s. Along the same lines, having a CSS class just for the fonts would have also helped. As it is, again, just to change the fonts, we had to fork the whole LESS folder. Doable. But that’s kinda taking the long way, yes?

    #18775
    Hyun Supul
    Keymaster

    Hi I am not the original author so I can’t answer why this has been implemented this way. But I will try to release a new version this week that improves on this. If you have a specific preference out of the different options, feel free to let me know.

    #18781
    GG2 Admin
    Participant

    Nothing specific. Just enqueu the fonts like any other script. This way they can be de-enqueued.

    Or, as mentioned, put this “stuff” in another .php and include that .php using get_template_part(). This way the child theme can have its own version of that template part.

    Thanks again.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.