Search code examples
wordpress

Wordpress: add a custom field option that's available to all posts


As part of my theme install, I'd like to add a set of custom field options to the wordpress database that would be available to all posts as long as my theme is active.

For example, I'd like to add these fields:

custom-image-1 custom-image-2 custom-image-3

And also these

custom-image-1-link custom-image-2-link custom-image-3-link

And then when a user goes to add or edit a post, they can insert values for each of these fields if they choose to...


Solution

  • You simply have to create a post and add these custom fields once to have them proposed for every next posts (in the custom fields part of the form).

    If you need to create a more integrated interface for these extra fields, you might be better off creating a plugin or looking for existing ones, such as this one.