WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to build an application that takes 2 pieces of input from a user and saves it to the database.

This is how users enter these two pieces of input; this form will be displayed using shortcode:

this is how users enter these two pieces of input; this form will be displayed using shortcode.

I have tried Custom Post Type, but its concept is foreign and confusing to me - I don't know if I should use pre-existing fields (Title, Content) or create the fields to store the input in the database, or create a separate table to store all of this information.

Here is my code:

// Register Custom Post Type
function int_init() {

    $labels = array(
        'name'                => 'Stories',
        'singular_name'       => 'Story',
        'menu_name'           => 'Story',
        'parent_item_colon'   => 'Parent Stories:',
        'all_items'           => 'All Stories',
        'view_item'           => 'View Story',
        'add_new_item'        => 'Add new Story',
        'add_new'             => 'New Story',
        'edit_item'           => 'Edit Story',
        'update_item'         => 'Update Story',
        'search_items'        => 'Search Story',
        'not_found'           => 'No story found',
        'not_found_in_trash'  => 'No story found in Trash',
    $args = array(
        'label'               => 'int',
        'description'         => 'INT information pages',
        'labels'              => $labels,
        'supports'            => array( 'title', 'editor', ),
        'hierarchical'        => false,
        'public'              => true,
        'show_ui'             => true,
        'show_in_menu'        => true,
        'show_in_nav_menus'   => true,
        'show_in_admin_bar'   => true,
        'menu_position'       => 5,
        'menu_icon'           => '',
        'can_export'          => true,
        'has_archive'         => true,
        'exclude_from_search' => false,
        'publicly_queryable'  => true,
        'capability_type'     => 'post',
    register_post_type( 'int', $args );


// Hook into the 'init' action
add_action( 'init', 'int_init', 0 );

All this code does is show the Title and Content fields in the backend. Should I just use the Title and Content fields to store the input, or should I create new fields, or create a custom table to store this data? How do I add new fields to use in a project such as this? How would you approach this problem?

EDIT: The content is unique per user inasmuch every user will be asked to enter two pieces of alpha numeric data per submission using a form created using shortcode. I know how to do this already.

The pair of data items entered will be saved to the database, and will need to be retrieved and posted on the public side of the site. The pair of data items will be retrieved and displayed on one page for each data pair as such:

I want to eat a peanut butter sandwich then drink a glass of milk. The submitted data is shown as bold. This retrieval and formatting of the data will be done using shortcode. I do not know how to create custom fields to make this work.

The data is submitted on the public side of the site by users who are not logged into the site.

To recap my problem, I don't know how to store the pair of data. Do I use pre-existing Title and Content fields or do I create something different?

share|improve this question
Is this content unique per user? You could use user meta fields. – toscho Oct 9 '13 at 8:03
As-written, this question will be largely opinion-based. Can you specify further: what specific data are being entered, and what will be done with those data? How/where will the data be used/displayed? – Chip Bennett Oct 9 '13 at 12:51
This question is not clear. Please try to explain your project in more detail. – s_ha_dum Oct 9 '13 at 15:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.