Forums

Add custom field to posts (2 posts)

  1. qprint1
    Member
    Posted 1 year ago #

    We would like to add a number of custom fields to the edit a post page.

    We are developing a theme and would like to add the fields when our theme is activated.

  2. Anders
    Member
    Posted 1 year ago #

    Add a meta box. Check out this page: http://codex.wordpress.org/Function_Reference/add_meta_box

    So, add a new meta box with your form inside of it, then add a hook to "save_post" that will process your data and write it to the DB. You can store the data in post_meta, or a serialized array within a single post_meta field - depends on how you want to use the data.

Topic Closed

This topic has been closed to new replies.

About this Topic