While you have already added custom code for some of your fields, it would be nice to have some flexibility to add certain field groups on any page or post you like. A block allows you to do that. In this video, register the block you want to create with Advanced Custom Fields and explore the settings for displaying and organizing your block, all in your child theme.
- [Instructor] An advanced custom field … gives us the ability to create blocks … for our WordPress editor … without the need to learn React, … which is how we would natively write blocks. … Instead, we're going to add a few php files … to our child theme. … Starting with the block definition. … Now in most cases, I recommend code … that has to do with the content … get added to a plugin. … But since most of this code has to do with the display, … and we want to keep everything together, … we'll add these files to our child theme. … First, let's go ahead and open … our functions.php file. … We're going to add an action to acf/init. … This is essentially acf's version of WordPress's … default init action, and it says … run this function as soon as acf is initiated. … Then we'll add our callback function. … We'll call this lil_define_block. … We're going to prefix all of our functions with lil. … Then we'll add the function. … Lil_define_block, and the first thing … we're going to do after we add our function …
- 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
Skill Level Advanced
1. Getting Started with ACF
2. Creating Field Groups with ACF
Field types overview3m 48s
3. Displaying Your Fields
4. Working with Data in ACF
5. Creating a Gutenberg Block
6. Cleaning Up the Admin
Next steps1m 13s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.