tags:

views:

39

answers:

1

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...

+1  A: 

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.

pixeline
I'm trying to do this programmatically via the theme installer so that when the user gets my theme and installs it, these fields are automatically made available to them. I don't want to have to tell them to create a post and add the fields themselves. I want to do this via script so the fields are just available to them on every post once they install my theme.
Scott B
In such case, the only possible way i see is to add a custom function in functions.php file inside your theme, hooking it to the admin display write UI event and have it show the custom fields.
pixeline
I agree completely. What I'm asking what is for the function api or code to create a custom field in the database that will be available for any post.
Scott B
i've never actually had to, so it's a new land for me. the doc refers to the "Default" theme's functions.php file as a good place to start, and use the wordpress function reference doc http://codex.wordpress.org/Function_Reference to build up your own admin ui.
pixeline