Select Page
  1. Getting Started with WordPress development

Getting started with WordPress is a pretty simple task compared to getting started with many of the other web development frameworks. WordPress is a great platform to learn to develop for because many websites on the internet are powered by it, some say close to 15% of the top websites. Its wide adoption and also the familiarity of small businesses and other developers make it an in demand skill in 2022.

  1. Development environment setup

In order to start developing on WordPress, you have to setup a local development environment where you can install the required packages needed to run it and download the latest version itself.

First, WordPress runs on PHP so you need to make sure to install at least PHP version 7.4. WordPress using a relational database to store all it’s persistent data, the database it uses is either MySQL or MariaDB. There are differences between the two databases but they aren’t important when just starting out. Lastly, you need a server to host the site and serve the PHP pages – I recommend Apache but Nginx is also acceptable if that’s your preference.

I won’t go into the details on how to install each package here because that will vary depending on your operating system, but if you don’t want to go through the hassle of installing the software on your computer individually – you can use something like Local by Flywheel which takes care of all the environment setup.

Here’s the list for your reference:
1. Install PHP

2. Install MySQL (at least v5.7) or MariaDB (at least v10.3)

3. Install Apache

  1. Creating a custom theme One of the most important tasks of WordPress development is creating a custom theme. A custom WordPress theme allows you to create an unlimited amount of custom designed page templates (which we will look at shortly) and create custom styles that will be saved across WordPress updates. Creating a WordPress theme really is as simple as creating a new folder within the “wp-content” folder in the WordPress installation directory. This new folder must at least have two files: a styles.css which contains theme css and secondly a functions.php which will hold all custom PHP related to the theme functionality.

The style.css file is where you can place most of the base css for your theme but in order to make it more manageable it is generally recommended to create a separate folder to hold your css which allows you to create individual styles in dedicated folders relating to there specific portion of the site. While style.css does hold css, within the functions.php file you can also “enque” (WordPress terminology) additional style files as needed. You will also add the name of your theme and other details in this file, including version.

The functions.php file doesn’t have any minimum required code, although it’s beyond the scope of this guide to go through every possible option here.

  1. Creating a custom page template Custom page templates are also a core feature that has made WordPress so popular. Now that you know what a custom theme configuration looks like, one more thing that is also included in custom WordPress themes are template files. You can place most of your custom templates within a dedicated “templates” folder in the root of your custom theme folder. A few page templates need to be in the root of the theme folder, like any custom templates for core WordPress pages, the default single.php template or archive.php, for example, which respectively allow you to create one template to handle all posts and a page to show a list of all past posts.
  2. Managing dependencies

With WordPress you can manage your project dependencies like you would any other PHP project. You can use composer to install any of your specific libraries you need to get your site up and running.

  1. Creating a custom plugin

In addition to being able to create a custom theme, you can also create what are called “plugins” in the WordPress ecosystem. A plugin adds additional capabilities to your WordPress site. There are already over 50k plugins created by other WordPress developers. Many of which you can use for free in your projects as well, more specifically those that offer the ability to extend their code through a PHP interface.

  1. Creating shortcode

You can create a shortcode either in a WordPress theme or plugin, but they function the same. They enable the ability to insert a line of code anywhere in your site that looks like “[my-shortcode]Display me![/my-shortcode]”and that will get passed to your custom PHP function, which then you can display anything you like.

  1. Extending the REST API

The last aspect of getting started with WordPress development is getting familiar with it’s REST API. WordPress exposes many endpoints to remotely get post data or add new ones. You can extend the default API to add your own custom endpoints which you can access through your frontend theme and gives you virtually unlimited number of possible sites you can build.