Is HTML File the PHP File? (Defer JS Parsing)

Hey guys, really awesome forum here this is exactly the type of people I need to be around for this leg of my Wordpress journey of speeding up my site.

I hope my beginner/novice tech skills aren’t too offputting but I just want to double check I’m about to edit the right file here…

So I’m about to fix the defer parsing of javascript on my site for speed…

The best article I’ve found says:

[quote]1. Copy above code.

  1. Paste code in your HTML just before the tag (near the bottom of your HTML file).[/quote]

I assume that when the author refers to the “HTML file” he is referring to the .php file in the wordpress database?

I couldn’t locate an HTML file in my database so I’m assuming its .php.

Anyone run into this?


Short answer: No.

PHP is leveraged to generate the proper html code which is stored in other files. This is done to make content management easier.

Example: When creating a HTML website, you usually start with a index.html file with the following structure.

header tags here, like css/js/favicon/meta/etc header content footer

When I finish my homepage, I continue with other pages. Now comes the fun part. I’m finally done, but realize my header menu is missing a link to a specific page ! I add it in index.html, but now I have to fix it in each page manually as well :frowning:

This can make fixing typos and adding new content very tedious.

What a CMS ‘basically’ does, is storing the html code, and calling it. The following is technically incorrect but serves as just an example:

<?php echo "" echo $head echo $body echo "" ?>

In the CMS (like WordPress), I created my menu. It’s stored in the database and I can use php to just call the variable that holds the content. So $head will contain the html code for blah. And it will dynamically insert that when I browse a page.

The advantage is that when I need to edit something, I only need to do it in 1 place, and all pages will be updates at the same time.

So you’ll need to figure out where the actual html code is stored and edit it there. If you use a CMS (like WordPress), then there are plugins that can help you add code to different sections of your page.