I have a custom page type set up called 'Products' and I need each of these post to automatically have multiple custom fields to set up a table of features/prices for the individual product pages.
Is there any way this can be done? Thanks.
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI have a custom page type set up called 'Products' and I need each of these post to automatically have multiple custom fields to set up a table of features/prices for the individual product pages.
Is there any way this can be done? Thanks.
I too had a question about this. Luckily, Chris_O answered it for me. You may also want to check out this question, too.
Here's an example of what I've done with meta boxes and you can see it's quite easy.
Using custom fields on custom post types is a pretty common task. What you essentialy need to do is adding a metabox and saving the values to the database. There already are some pretty good explanations of how to achieve what you want to do.
You should check out the official documentation of add_meta_box()
, there's a fully working example in there!
― André