Tag: Javascript
Defer Parsing of JavaScript in WordPress


It’s a common complaint when you run your WordPress site through any “page speed score” tool: “defer parsing of JavaScript” and/or “remove render-blocking JavaScript.” Today, building on an article Fred first wrote in 2015, I’m going to discuss a was to solve that. It’s been possible since WordPress 4.1, which introduced of a new filter, script_loader_tag. This filter lets us easily change the HTML markup of enqueued script elements—that is, of JavaScript files that were correctly added into a WordPress site using WordPress’s wp_enqueue_script function.
How to Include JavaScript Files on Your WordPress Site with wp_enqueue_script()


Want to know how to include a JavaScript file onto your WordPress site? In this Quick Quide we use an awesome WordPress function called wp_enqueue_script() that is the correct way to include JavaScript files in WordPress. Whether your JavaScript files are for Vue, React, JQuery, or something else, this is how you include JavaScript files in WordPress pages.
How to Minify and Combine CSS and JS with Autoptimize


To concatenate and minify your CSS and JavaScript is good advice for speeding up your site. There are lots of ways to do it, but the best we’ve found in WordPress is a plugin called Autoptimize.
How to Properly Modify JavaScript Files in a Parent Theme


I recently needed to modify a JavaScript file in a WordPress parent theme. The script was doing almost what I wanted, but not quite, so I wanted to make minor changes. In your case, you might want to entirely override a parent theme JavaScript file in your child theme, or even deactivate a parent theme JavaScript file altogether.
The Four Languages You Must Know to Understand WordPress


Learning WordPress development starts with a lot of key questions, including this one: “What language is WordPress written in?” Another common one is “Should I learn PHP or JavaScript first?” WordPress programming languages is a big topic, but we’ll cover all you need to get started.
Free JavaScript for WP Conference on Friday! David’s Speaking


What’s better than an online conference with some of the best speakers in WordPress? I’ll get there in a second. Here are the schedule elements that caught my eye:
How to Use WordPress’s Iris Colorpicker on the Front End


I learned a few things today: first, that WordPress has a built-in colorpicker called Iris, and second, that you can use it on the front end of your website if you need custom colorpicker functionality.
Why Use PHP in 2018


Over on Thoughtful Code, I wrote about why even in 2018 I’d choose PHP to make a new software application in. The heart of my reasoning is the conclusion:
How to Conditionally Enqueue a JavaScript File in WordPress


Enqueuing is the WordPress way to add a stylesheet or JavaScript file on a page. We already published a Quick Guide about including your JavaScript in WordPress. This time, though, we’re adding an extra wrinkle: how do you only enqueue a JavaScript file on certain pages of your WordPress site. That’s the focus of this here Quick Guide.
Comparison of JavaScript Frameworks for WordPress at Post Status
Recently at the essential Post Status podcast, the essential JavaScript educator Zac Gordon sat down with Brian Krogsgard to compare JavaScript frameworks and libraries in a WordPress context.