Modern WordPress Theming
If you are new to WordPress then it is better to first learn about the dashboard before getting into the other things.
However I am assuming that anyone reading this understands the fundamental pieces of using WordPress and really just wants to understand how to write the code to build on top of the WordPress platform.
Yes I agree that plugins are great and custom functions are extremely useful. But Theming is the requirement for every WordPress site. Whether you are coding a new theme from scratch or customizing an existing one, you really want to be comfortable with the WordPress Theming system.
The only required files for a theme are the style.css stylesheet and the main index.php. WordPress theming works by the conditional files so if you don’t have a homepage.php for the homepage, WordPress defaults to index.php instead. In the same way, if your theme doesn’t have author.php for the author archive page then you can just use archive.phpinstead.
WordPress theming is smart and easy to pickup once you learn the hierarchy. Here is the list of minimum bare-bones files that I believe they should be in every WordPress theme:
  • css – the theme’s official stylesheet with the theme information.
  • php – it is ultimately the fallback page for anything without the unique theme file.
  • php – your blog’s homepage whether static or archive content.
  • php – a single post or article layout.
  • php – a single page layout
  • php – used as a catch. All for archives like categories, tags, authors and dates.
  • php – the default 404 error page layout
Note that advanced themes should include more specific files to help define better content and page layout design.
To learn more about this, check out the template files list in the WordPress’ official documentation. WP also offers a handy diagram explaining how theme file hierarchies operate:
Each theme is typically developed as a standalone entity which can offer theme dependent plugins and functions. All themes are written in the PHP so it is possible to include a theme file that operates like a function library, thus restricting features to a single theme.
Basic Plugin Development
The two biggest facets of WordPress development are themes and plugins. Since theming affects the site’s layout and interface, that should be your first area of study. The natural follow-up would be inquiring in plugin development.
Building a WordPress plugin is tough but easy to learn if you practice. There is enough material available online that it should not be considered much of hurdle anymore.
It is beneficial that so many free plugins are available that it is possible to build WordPress websites with free third party plugins without ever writing your own. However skilled WordPress developers should at least understand how plugins function and how to write one if the need arises.
Two very important terms that you understand are filters and actions. They both take in the same code and return something, but do so in different ways.
Filters are means to the return code like a string of HTML or a new updated variable. Actions return code directly into hooks that are predefined in WordPress themes, plugins or even by the WordPress core.
Check out this Stack thread to learn more.
These different methodologies have functions which mirror each other. For exampleadd_action() and add_filter() behaves similarly for actions and filters respectively. This is also true of do_action() and apply_filters().
Plugin development requires a lot of reading and practice. You will be confused along the way but that’s the part of the learning curve.
Developing Internal Features
WordPress offers a handful of alternate features via internal classes and APIs that are accessible to all the developers. Some of them are rather advanced like the rewrite API or the REST API, but new developers should consider starting with the more basic features:
Functions.php File
Everyone has their own opinion about the functions.php file. This file stores the theme specific functions and settings that define how the theme operates through shortcodes, hooks and filters.
Your theme’s function file can even have custom PHP functions that you call from within other theme files. Some developers feel that this is the bad practice but it is the best way to organize theme specific functions into one library.
Shortcodes
A shortcode is defined in the PHP but can be directly added into the content. These are typically denoted with the square brackets in the WordPress post or page editor with something like to build an image gallery.
Check out the shortcodes documentation to see more examples and learn how they operate and where they are used.
Custom Post Types
Before the WordPress 3.0 there were only a few default post types: attachments, posts, and pages. These are often more than enough and they work great for the majority of WordPress websites.
But the addition of CPTs allowed developers to create new types like newsletters, ecommerce products and user submitted content.
These custom post types can also have their own custom taxonomies beyond the default tags and categories. CPTs can be defined via plugin or in a theme’s functions.php. There is the lots of flexibility once you learn how these works and how to write your own.
Custom Fields
Couple of designers completely understands the power of custom fields until they begin utilizing them. When you write another post in the admin panel, you’ll notice distinctive widgets for including tags, categories, a highlighted image, and so on.
Custom fields can be defined to add more widgets onto the page for extra content known as meta-data. The popular SEO plugin Yoast does this by adding their own custom fields in the post or page section to update the title or Meta content.
It is possible to add a field that stores any type of metadata whether it is multiple featured images or alternate author bios. The capabilities are limitless once you learn how to build the custom fields and put the information to the good use.
Advanced WordPress Development & Beyond
The things that I have covered in this post might take someone years to master and fully apply to their workflow. WordPress is easy to get started but difficult to master.
Beyond the concept of theme and plugin development you might try incorporating specific WordPress APIs into your learning list. These topics are really for the advanced developers that want to understand everything that WordPress has to offer.
Here are a few ideas to get you started:
Always remember that learning is the process that never stops. To become a skilled developer you need the consistent effort and a passion for the industry.
If you practice these topics regularly then I guarantee that you will learn a lot and find yourself among the ranks of many other professional WordPress developers.