• I’m following a tutorial on creating a customer theme. In the when converting the html files to php the instructor split the header and footer into their own files, deleted the CSS, Font-Awesome and Google Font scripts/links and replace these with
    <?php wp_head(); ?>

    After this his code worked fine but my icons were gone, however the google fonts still worked.

    My two questions are:

    1. It’s pretty obvious how it grabs the CSS file but how does it know about the Google fonts?

    2. Since the Font Awesome link was the only thing not working and it was the only script, as opposed to link, am I correct in assuming that wp_head() only forks for links?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • <?php wp_head(); ?> is a hook that allows WordPress, themes, and plugins to add HTML wherever it is placed. WordPress uses it to output all the scripts and stylesheets from themes and plugins between the <head></head> tags of your theme. For this to work themes and plugins need to “enqueue” their scripts and styles. How to do this is documented here. So you will need to make sure that the Font Awesome stylesheet is enqueued by your theme.

    Thread Starter lgehrig4

    (@lgehrig4)

    Thank you @jakept , got then working

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Help me understand wp_head()’ is closed to new replies.