We created a custom post type (CPT) for trading cards. We use Advanced Custom Fields to create custom attributes for this post type. Gravity Forms is used as the form provider to input card data.
The following will create a new card
post type:
- User visits the trading card page
- User fills out the form
- Form Submit creates a new
card
post from the form data. The Advanced Post Creation add-on is used to - User is directed to the specifc post created by the form submit. Example here
Card attributes start with "card_" (that's the word card with an underscore)
card_first_name
= Player First Namecard_last_name
= Player Last Namecard_sport
= Name of the Sportcard_team
= Name of the Teamcard_brand
= Name of the Brandcard_is_graded
= Is this card Gradedcard_grading_company
= The grading companycard_grade
= The gradecard_is_pc
= Is the card a Personal Collection (PC)card_is_fs
= Is the card For Sale (FS)card_is_ft
= Is the card For Trade (FT)card_sale_price
= Card Sale Pricecard_trade_demand
= Card Trade Demand(s)card_front_image
= The front of card imagecard_back_image
= The back of card imagecard_description
= Rich text editor field
The custom post type (CPT) code is in the child theme functions.php file
custom_post_type()
is the name of the function that creates the CPT.
- The MLS form is built with
GravityForms
- The
Post Creation
plugin is used to create a post from a GravityForms submit action - When the form is submitted is creates a new custom post type of
card
- The CPT (custom post type) custom fields are all populated by the data in the form fields
- When displaying the
card
post you simply reference the custom fields for that post (NOT, the ACF values)