Unlock your potential with a Pro Membership
Here is where you propel your career forward. Come join us today. Learn more.
Add a New Custom Field
Lab: WordPress Post Metadata (Custom Fields) Basics
Video Runtime: 07:19
Let’s add a new custom field, which is a post metadata, to the database. You’ll use add_post_meta()
and walk through using it. You’ll see what it does in the database, how to use it, what the different arguments do, and even peak into WordPress Core.
This function adds a new post metadata record WHEN:
'unique'
is set tofalse
(you can get duplicates with this one).'unique'
is set totrue
AND the meta value does not already exist in the database for that post ID.
Huh? Watch the video and do it with me to better understand what this function does and how to add a new record for a post.
Code. Eat. Code. Sleep. Dream about Code. Code.
Episodes
Total Lab Runtime: 02:03:31
- 1 Lab Introductionfree 09:52
- 2 What is a Custom Field?free 15:55
- 3 What is a Meta Box?free 06:24
- 4 Project: Add a Subtitlepro 07:16
- 5 The Databasepro 11:48
- 6 Get Subtitle Post Metadatapro 15:26
- 7 Add Subtitle to Genesis Themepro 12:19
- 8 Update an Existing Custom Fieldpro 17:15
- 9 Add a New Custom Fieldpro 07:19
- 10 Delete a Custom Fieldpro 10:13
- 11 More Custom Field Functionspro 06:25
- 12 Wrap it Upfree 03:19