Tag: PHP

How to Create a WordPress Theme from Scratch

When it’s time to choose a WordPress theme for your website, you have tons of options. Perhaps the most powerful is to forego the readymade themes on the market and build your own. Building your own theme puts you in complete control when it comes to looks and functionality. It can take your project up to that next level. That’s why today, we’re going to show you how to create a WordPress theme from scratch.


How to Display Posts on a Category Page, Divided Into Their Respective Subcategories

wordpress sort categories and subcategories

Say you have a category page on which you’re asked to display all the posts that belong to that category’s subcategories. So far no sweat – a category page displays by default all its descendant posts, whether they belong directly to that category or any of its subcategories. But here’s the twist: say you have to display them in such a way that the subcategory names are displayed (challenge no. 1), and under each subcategory’s name you have to display all its posts (challenge no. 2).


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.



Understanding “Server-Side” and “Client-Side” in WordPress

Distance | wordpress server and client

This article explains “server-side vs. client side” in WordPress development. This distinction, and how the server side and client side interact, is at the core of not only WordPress development, but of any real understanding of how the web works.




Getting to Know WP_Query

The WP_Query class is an exceptionally powerful tool in WordPress. As you may know, every WordPress site contains a database that stores many posts (of many post types) that make up the bulk of that site’s content, and WP_Query is the best way to fetch or retrieve a given selection of those posts for processing. So your theme files use it on regular basis, and a lot of plugins on your WordPress site will it.



PHP Foreach: All You Need to Know

One of the most-used functions in my life with PHP is foreach. Partly, this is because it’s just an exquisitely named function, and it maps well to how I think. Partly this is because it’s kind of the backbone of a webpage: iterate through a set of things, operating on some selectively, and then display them all.