1. Key Intuitions for WordPress Development
Our goal in this section is to answer, intuitively, “What is WordPress?” In other words, we’ll work to shine light on questions like the following: When we say a site is “a WordPress site,” what… 1. Key Intuitions for WordPress Development
WordPress is a Factory: A Technical Introduction
Key Takeaways: The easiest way to understand what WordPress does, and how it does it, is to dig into the following analogy: WordPress is a factory that makes webpages. The WordPress factory’s raw materials are… WordPress is a Factory: A Technical Introduction
What "Post," "Page," and "Webpage" Mean in WordPress
One of WordPress’s biggest flaws is its imprecise vocabulary. Many otherwise simple concepts are made complex by inaccurate or conflicting terms. Later in this book, watch out for this problem with: Hooks, actions, and filters… What "Post," "Page," and "Webpage" Mean in WordPress
When to Use WordPress, When Not to Use WordPress, and Why
Key Takeaways: WordPress is great for some uses, overkill for others, and poorly suited for still others. For websites built primarily to display information—which is most websites—we’d argue that WordPress is the right solution most… When to Use WordPress, When Not to Use WordPress, and Why
2. Details of the WordPress Technical Environment
This question describes the general software and hardware architecture that makes WordPress development possible. Our goal isn’t to make you into a systems administrator, but we do want to make you comfortable with the core… 2. Details of the WordPress Technical Environment
The Four Languages You Must Know To Understand WordPress
Key Takeaways: You’ll work with four primary languages in WordPress: HTML, CSS, PHP, and JavaScript. HTML (HyperText Markup Language) is the fundamental language of the web. It’s a declarative language rather than a programming language,… The Four Languages You Must Know To Understand WordPress
Understanding "Server-Side" and "Client-Side" in WordPress
Key Takeaways: WordPress lives on a web server, and delivers web content to a user’s web client (his or her browser). Processes that occur on the server are called “server-side,” as is the server environment… Understanding "Server-Side" and "Client-Side" in WordPress
A WordPress LAMP? An Introduction to WordPress Infrastructure
Key Takeaways: WordPress sites’ most common software infrastructure is called the LAMP stack: Linux, Apache, MySQL, and PHP. Linux is the operating system on which most web servers (the computers that store websites) run. However,… A WordPress LAMP? An Introduction to WordPress Infrastructure
3. Core Concepts of WordPress Themes and Plugins
In this book—and in most WordPress developers’ careers!—”WordPress development” is a synonym for “theme and plugin development.” That may seem narrow or restrictive at first glance, but let’s look at what “theme development” and plugin… 3. Core Concepts of WordPress Themes and Plugins
What WordPress Themes Are For
Key Takeaways: Every WordPress site has an active theme: a standalone piece of software designed to integrate with WordPress’s core software in numerous defined ways. A WordPress theme’s job is to control the site’s presentation:… What WordPress Themes Are For
Anatomy of a WordPress Theme
Key Takeaways: A WordPress theme is made of a set of consistent parts. The crucial parts of a theme include style.css, functions.php, and several kinds of PHP template file (such as header.php, footer.php, and index.php).… Anatomy of a WordPress Theme
Core Concepts of WordPress Themes: 1. The Template Hierarchy
Key Takeaways: The WordPress template hierarchy determines which PHP template files will be used to construct a given webpage on your site, based on the type of post content requested: for example, whether the webpage… Core Concepts of WordPress Themes: 1. The Template Hierarchy
Core Concepts of WordPress Themes: 2. Processing Posts with The Loop
Key Takeaways: The Loop is an extremely important topic in WordPress development: it is how WordPress renders a bundle of posts fetched from the database into an HTML webpage. The Loop is a PHP while-loop… Core Concepts of WordPress Themes: 2. Processing Posts with The Loop
Core Concepts of WordPress Themes: 3. Adding Functionality with functions.php
Key Takeaways: functions.php is a specially named PHP file that can be located inside any WordPress theme. WordPress knows to execute the code in functions.php during its normal PHP processing. functions.php’s job is to add… Core Concepts of WordPress Themes: 3. Adding Functionality with functions.php
Introduction to WordPress Plugin Development
Key Takeaways: WordPress plugins are outside code that alter the functionality of WordPress in virtually any way possible. Some plugins are very simple, and others are very complicated; “plugin” simply describes where the code is… Introduction to WordPress Plugin Development
4. How Everything Talks to Everything Else
WordPress has lots of moving pieces, and it’s crucial to understand how they fit together. This section tackles that topic: WordPress Hooks, Actions, and Filters: What They Do and How They Work explains WordPress’s hooks… 4. How Everything Talks to Everything Else
WordPress Hooks, Actions, and Filters: What They Do and How They Work
Welcome! This is a preview chapter of Up and Running. Enjoy 🙂 Key Takeaways: Hooks are a crucial WordPress feature that allows developers to insert custom code into WordPress’s PHP processing, at specified junctions during… WordPress Hooks, Actions, and Filters: What They Do and How They Work
Including Custom Scripts and Styles In WordPress
Key Takeaways: The proper method to include JavaScript files and CSS stylesheets to WordPress is by enqueueing them. This allows for flexibility and customizability that adding these files directly to your site’s header does not.… Including Custom Scripts and Styles In WordPress
Understanding and Using WordPress Child Themes
Key Takeaways: A child theme is a specially registered WordPress theme that inherits most of its properties from a declared parent theme. A major reason to create a child theme is to be able to… Understanding and Using WordPress Child Themes
5. WordPress "Tag" Functions
WordPress has hundreds of functions, which do everything from query the database to automatically capitalize the “p” in “WordPress.” However, useful patterns do emerge, and two of these patterns are in WordPress’s families of “tag”… 5. WordPress "Tag" Functions
The Magic of the_() and get_the_() Post Template Tags
Key Takeaways: Template tags is the generic term for functions designed to work mainly inside WordPress’s PHP templates, especially inside The Loop. A common pattern, true across most template tags, is that functions beginning with… The Magic of the_() and get_the_() Post Template Tags
WordPress’s Conditional Tags
Key Takeaways about WordPress Conditional Tags: WordPress’s conditional tags are prewritten WordPress functions that test several dozen distinct criteria, mostly about the nature of the post or posts that have been retrieved for processing. Each… WordPress’s Conditional Tags
6. WordPress Building Patterns
This section introduces several intermediate development practices in WordPress, each of which can level up your theme or plugin development by adding custom functionality that would otherwise be difficult to access. Understanding and Creating WordPress… 6. WordPress Building Patterns
Understanding and Creating WordPress Custom Post Templates
Key Takeaways: Custom post templates are a simple way to create custom layouts for individual posts. They are commonly used for things like About pages and Contact pages. Setting a post to use a custom… Understanding and Creating WordPress Custom Post Templates
Make Your Themes Better by Getting to Know get_template_part()
Key Takeaways about template parts in WordPress: “Template parts” are incomplete pieces of WordPress PHP templates, pulled out into their own PHP files. Template files access them with a function called get_template_part(). The primary reason… Make Your Themes Better by Getting to Know get_template_part()
Understanding and Creating Shortcodes
Key Takeaways: Shortcodes are a simple way to add custom functionality—with dynamic user input— to post contents. Shortcodes can accept user-defined attributes, which work as function arguments that alter the shortcodes’ output. Shortcodes are turned… Understanding and Creating Shortcodes
7. Working with Custom Post Data
This section introduces three tools that are absolutely crucial for extending the functionality of WordPress’s posts: custom post types, custom taxonomies, and custom fields. Why and How to Use Custom Post Types in WordPress introduces… 7. Working with Custom Post Data
Why and How to Use Custom Post Types in WordPress
Key Takeaways: Custom post types allow WordPress content types to be more flexible than the defaults (such as Post and Page). Elements added by plugins like “Product,” “Contact Form,” or “Portfolio Item” are custom post… Why and How to Use Custom Post Types in WordPress
Organizing Your WordPress Data: Understanding Custom Taxonomies and Custom Fields
Key Takeaways: Custom taxonomies and custom fields are two primary ways to add data about WordPress posts. Collectively, this “data that isn’t the primary post content” is called metadata (however, the term “post meta” or… Organizing Your WordPress Data: Understanding Custom Taxonomies and Custom Fields
How to Create and Use WordPress Custom Taxonomies
Key Takeaways: Creating custom taxonomies in WordPress revolves around a WordPress function called register_taxonomy(). This function is passed an array of parameters that determine properties of the taxonomy, and then hooked to WordPress’s init event.… How to Create and Use WordPress Custom Taxonomies
How to Create and Use WordPress Custom Fields
Key Takeaways: Custom field data can be added to a post in the “Custom Fields” section of the Post Editor, or programmatically using update_post_meta(). update_post_meta() is also the function to change a custom field’s value… How to Create and Use WordPress Custom Fields
8. WordPress APIs
WordPress has numerous APIs (application programming interfaces): intentionally designed “ways you do” specific things in the software. Without mentioning the term much, previous sections have been all about WordPress’s APIs; the hooks system is an… 8. WordPress APIs
Mastering the Options API in WordPress
Key Takeaways: Each WordPress site contains many sitewide options—from the site’s time zone setting to a user-controlled footer background color. Each of these site options is stored as a simple key-value pair inside the wp_options… Mastering the Options API in WordPress
Getting to Know the WordPress Transients API
Key Takeaways: Caching is a key process for speeding up website performance. It takes difficult-to-retrieve data (such as extensive calculations or complex database queries), saves it, and serves the saved values rather than running the… Getting to Know the WordPress Transients API
Registering and Displaying WordPress Widget Areas
Key Takeaways: Widget areas are regions in a WordPress site into which widgets can be inserted. As a presentational element of a site, widget areas should be registered in the theme. Widget areas are often… Registering and Displaying WordPress Widget Areas
Registering and Displaying WordPress Menu Areas
Key Takeaways: Menu areas are the regions inside a WordPress site into which WordPress navigation menus can be inserted. As a presentational element of a site, menu areas should be registered in the theme. WordPress… Registering and Displaying WordPress Menu Areas
The Concepts of Object-Oriented PHP You Need to Understand for WordPress Development
Key Takeaways: Object-oriented programming is a dominant programming paradigm that encourages programmers to think in terms of distinct classes of things. All members of a class share particular methods (functions) and properties (variables). For example,… The Concepts of Object-Oriented PHP You Need to Understand for WordPress Development
A Complete Guide to Making Your First WordPress Widget
Key Takeaways: Registering new widgets is a complex process. It may be undertaken in a theme or a plugin, depending on whether the widget is primarily presentational or functional. The Widgets API is object-oriented. Every… A Complete Guide to Making Your First WordPress Widget
Getting to Know WP_Query
Key Takeaways: WP_Query is a powerful tool that allows you to fetch custom “bundles” of posts from the WordPress database—based on criteria you specify—using relatively simple PHP syntax rather than complex MySQL queries. As WP_Query… Getting to Know WP_Query
Working with HTTP APIs in WordPress
Key Takeaways: The WordPress HTTP API simplifies making remote HTTP requests: requests for information that return (and may also alter) webpage content using HyperText Transfer Protocol (HTTP), the fundamental means of communication on the internet.… Working with HTTP APIs in WordPress
Introduction to the WordPress REST API
Key Takeaways: The WordPress REST API is a technology that exposes each WordPress site’s data to be accessed and changed by external applications: applications that can be written in any language, and can be located… Introduction to the WordPress REST API
Writing a Very Simple Web Application with the WordPress REST API
Key Takeaways: An app that pulls WordPress REST API data can be written in any programming language, can be run from any web server, and does not need to use or involve WordPress itself. The… Writing a Very Simple Web Application with the WordPress REST API
How to Register Custom WordPress REST API Routes
Key Takeaways: Registering custom WordPress REST API routes lets you expose any WordPress data you like to the world. Registering routes centers around a method called register_rest_route(), which defines a route (a URL), a method… How to Register Custom WordPress REST API Routes
Gutenfuture: How Gutenberg Will Affect Working in WordPress Generally
Pre-S: For more Gutenberg, you can watch our Up and Running Gutenberg Roundtable discussion, where we discuss what’s happening with Gutenberg in the next year. Watch the video (or read the transcript) here. Key Takeaways:… Gutenfuture: How Gutenberg Will Affect Working in WordPress Generally
Gutenfuture: How Gutenberg Will Affect the WordPress Code You Write
Pre-S: For more Gutenberg, you can watch our Up and Running Gutenberg Roundtable discussion, where we discuss what’s happening with Gutenberg in the next year. Watch the video (or read the transcript) here. Key Takeaways:… Gutenfuture: How Gutenberg Will Affect the WordPress Code You Write
Further Reading
The WordPress Options, Settings, and Customizer APIs How to Make a WordPress Admin Options Page (Without Using the Settings API): https://wpshout.com/make-wordpress-admin-options-page-without-using-settings-api/ Making an Admin Options Page with the WordPress Settings API: https://wpshout.com/making-an-admin-options-page-with-the-wordpress-settings-api/ Making Themes More… Further Reading