Skip to main content

Custom Fields are fields that can hold arbitrary extra information known as meta-data.

A custom field, also known as meta-data, or , is information such as strings, integers, randomly generated values, etc., that is related to a WordPress post and custom post types.

These values are stored in the database, referenced later by their meta_key and association to the originating post.

As part of a , custom fields can create additional methods for filtering and sorting posts.

Here is an example of calling up a custom field value whose key is my_lunch_today:

echo 'Today I am eating <em>' . get_post_meta($post->ID, 'my_lunch_today', true) . '</em>';

Which may produce something like:

Today I am eating tuna salad

For more information on using custom fields, see: Custom Fields « WordPress Codex