Tag: WordPress functions

Course: WordPress Theme Development (Core Concepts)

person learning wordpress theme development

Welcome! WordPress themes are one of the first and most important topics that one must understand to be good at WordPress development. Themes underlie the entire visual half of WordPress site, but often grow to do even more. We’re hoping your find these free content very helpful, as we think it covers some of the most important concepts in doing WordPress theme development for yourself.




Adding an is_product_subcategory() Conditional Tag to WooCommerce

wp mayor | is_subcategory

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.


Make Your Site Faster with Async and Deferred JavaScript: Introducing script_loader_tag

Today I’m going to discuss a new, and very nice, site speed improvement that became possible in WordPress 4.1. What changed? The introduction 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.