Tag: WordPress functions
Course: WordPress Theme Development (Core Concepts)


Welcome! WordPress themes are one of the most important topics that one must understand to be good at WordPress development. Themes underlie the entire visual half of WordPress sites, but often grow to do even more. Because of the visual importance, they’re a great place to dive in if you’re interested in getting to the “code-side” of WordPress. I myself “cut my teeth” on WordPress themes back in 2007 and 2008. WordPress themes were where I started to come to grips with the power (and limits) of PHP, CSS, and HTML. So this course is great for newbies, and those just looking to confirm their understanding of the whole system.
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.
Learning PHP for WordPress Development: Control Flow Basics


Welcome to this introduction to PHP control flow! This article continues our series explaining the basics of PHP for WordPress development.
Learning PHP for WordPress Development: Understanding PHP’s return


Welcome to this rundown on return in PHP! This article continues our series explaining the basics of PHP for WordPress development.
Learning PHP for WordPress Development: Understanding PHP’s echo


Welcome to this rundown on echo in PHP! This article is part of our series explaining the fundamentals of PHP for WordPress development, so that you can start learning the language of WordPress “under the hood” and unlock the powers of a full-fledged WordPress developer.
WordPress is a Factory: A Technical Introduction


“WordPress is a factory” is a core analogy designed to clarify what WordPress is as a technical system.
David Writes on Insecure PHP and WordPress Functions for Smashing Magazine


Your first million dollars. The game-winning catch. A guest post in Smashing Magazine. These are life’s moments of pure success, and David had one of them this week. We’ll keep you posted on the other two.
Adding an is_product_subcategory() Conditional Tag to WooCommerce


I’ve got a project that needs to treat WooCommerce category pages differently from its subcategory pages. Both use taxonomy-product_cat.php, though. What I’d really love to do is change just the search field in that template, depending on whether a particular page is showing a top-level category or a subcategory.
Practical Uses of pre_get_posts


In WordPress, pre_get_posts is an action that makes it possible to modify an existing WP_Query, before that query is actually run. pre_get_posts offers some solutions that are more performant than writing a custom WP_Query, and enables solutions to other problems that would be quite difficult otherwise.