WordPress has support custom fields, or post meta, for a long time, but creating post meta in the post edit screen can be tedious and time-consuming. It also limits the type of content you can add. Advanced Custom Fields allows you to take that post meta support and transform your post edit screen into a completely custom interface.
- When you first install WordPress, sometimes referred to as Vanilla WordPress or WordPress out of the box, the editor experience is a pretty minimal one. For posts you have the Title, the Editor, Status, Categories, Tags, the Featured Image, Excerpt and Discussion or comments. For pages, you have even less. You still have the Title and the Editor, but you don't have Categories, Tags or the Excerpt. You could have Page Attributes which might include a page template depending on your theme. While this is great for straightforward content, there may be times where you want to add more data to a page. And that's where Custom Fields, sometimes called post meta come in. Custom Fields allow theme developers the ability to extend the data on their posts, pages or custom post types. By creating separate entries for certain pieces of data, and then adding that information to their theme. So if we want to add a listening to field here, we can. The benefit of this is that you know that information will show up in the same exact spot on every blog post because it's coded directly into the template. The information is more easily searchable because it's not just part of a big blob of text. It has a dedicated key or keyword. And it improves the user experience because post authors know exactly where to input that information. Part of the problem with custom fields however, is that while they do allow us to add more better data to our content, the way we create them is tedious. And they often don't allow for something more complicated than a single line of text. That's where Advanced Custom Fields comes in. Advanced Custom Fields creates a robust interface for creating custom post types and associating them with posts and pages. We can add new types of content and create different field types like Text or Text Area or even something more complicated like an Image, Wysiwyg Editor or a Google Map. This allows us to focus on building the right kind of content and not how we're going to build out a potentially complicated application. And as you'll see later in this course, Advanced Custom Fields lets us display only the information that we want to display on a given post, page, or post type. Advanced Custom Fields is the easiest way for us to create smarter, more flexible content for our WordPress sites. And in this course, we're going to take a deep dive into that.
- What are custom fields?
- Creating field groups
- Adding content to fields
- Displaying fields on a child theme
- Creating and displaying repeater fields
- Creating a submission form
- Creating a Gutenberg block with PHP only
- Writing rules for field display
- Organizing fields
- Exporting field groups