Address Field

Per this comment:
https://premium.wpmudev.org/forums/topic/request-for-field-type-for-custompress#post-73783

I'd like to create an address field for CustomPress. I don't want to use a big text box, I'd like to make it more standardized (address1, address2, city, state, country, zip), but am not sure exactly how to go about setting this up.

Thanks in advance.

    DavidM

    Hello again nbostic,

    I'll try and keep this as simple as possible. To create the Custom Post Type "customer" that has the fields address1, address2, city, state, country and zip, you can follow this quick guide. This doesn't cover the actual display of these customer post types in the front-end because there are so many different options for the display of that data.

    To begin, navigate in your admin to CustomPress > Content Types.

    From the available tabs, select Post Types, then press Add Post Type and edit as follows.

    For the Post Type, enter "customer"

    In the Supports sub-section, ensure the following check boxes are ticked.
    Title
    Editor
    Custom Fields

    In the Labels sub-section, you'll only need to enter the following for the first two fields.
    Name: Customers
    Singular Name: Customer

    That's it for the initial setup of the Post Type: customer.
    You can press the Save Changes button at the bottom of the screen to continue.

    From here, you can navigate to the Custom Fields tab and press Add Custom Field.
    Create new custom field types for each of your specified fields using the following information.

    Customer Fields > Add Custom Field
    Field Title: address1
    Field Type: Text Box
    Field Description: Address 1
    Post Type: customer
    (select from multi-select box)
    Customer Fields > Add Custom Field
    Field Title: address2
    Field Type: Text Box
    Field Description: Address 2
    Post Type: customer
    Customer Fields > Add Custom Field
    Field Title: city
    Field Type: Text Box
    Field Description: City
    Post Type: customer
    Customer Fields > Add Custom Field
    Field Title: state
    Field Type: Text Box
    Field Description: State
    Post Type: customer
    Customer Fields > Add Custom Field
    Field Title: country
    Field Type: Text Box
    Field Description: Country
    Post Type: customer
    Customer Fields > Add Custom Field
    Field Title: zip
    Field Type: Text Box
    Field Description: Zip Code
    Post Type: customer

    That should about do it. You should now see in your admin, a Customer post type menu section. Adding a Customer, you should see the various fields we just created.

    You might want to have a list-box of countries and states rather than a simple text box for entering them in. That's where Taxonomies come in. However, given the scope of these two fields, it's a bit much for such a simple walk-through as this.

    Hope that helps! Let me know if you have any questions.

    Cheers,
    David