Community Forums › Forums › Archived Forums › General Discussion › Creating Custom Post Types and Custom Fields
Tagged: custom post types
- This topic has 8 replies, 4 voices, and was last updated 9 years, 6 months ago by Brad Dalton.
-
AuthorPosts
-
April 7, 2015 at 6:00 pm #146990jayhleeMember
I'm trying to figure out the best way to create custom post types and custom fields with WP/Genesis. I've worked with ExpressionEngine for years, but am trying to embrace WP/Genesis as my new framework to build from, so all this is new and foreign to me.
For example, if I'm creating a law firm website, what's the best way to create an "attorneys" post type that allows each attorney entry to have its own set of custom fields (e.g. list of practice areas, languages spoken, education, office location, etc.) that are specific and will only show to the attorneys post type? Using WP's built in custom field types seem cumbersome and not the most intuitive for the end client to use, but I'm not sure if using Advanced Custom Fields is the best way to go—and if that even works with Genesis.
If someone could give me a little guidance on this, I would be most grateful! Thanks!
April 7, 2015 at 6:03 pm #146992Brad DaltonParticipantI'd use the code from the Executive Pro themes functions file for the CPT
And ACF for the custom fields meta boxes otherwise you would need to hand code them
April 7, 2015 at 7:03 pm #146998jayhleeMemberThanks, Brad. I definitely want to use ACF because of it's flexibility and power. Genesis has no hiccups or issues when using ACF?
April 7, 2015 at 7:06 pm #147000Brad DaltonParticipantNo but you do need to use the right code like genesis_get_custom_field
April 7, 2015 at 9:25 pm #147008DTHkellyMemberGenesis + ACF video tutorials:
http://cobaltapps.com/forum/forum/main-category/main-forum/30236-using-dwb-with-acf-advanced-custom-fields-brilliantApril 8, 2015 at 3:06 pm #147111BadlywiredMemberACF is used by lots.
Personally I prefer to use the Custom Meta Box 2 library and 'hard code' the custom fields. CMB2 doesn't have a fancy gui, but is really simple object based definition of custom meta boxes https://github.com/WebDevStudios/CMB2
My main logic here is I don't like the concept of a 'front end' that can change the custom fields that are actually hard coded into a theme, it means an administrator can break things. If you are going to design a theme and code functionality to use custom fields, its no hardship to define their meta boxes in simple OO code definitions.
My techy blog WordPress and stuff badlywired.com
April 8, 2015 at 4:22 pm #147121jayhleeMemberAfter digging into things a bit more, I've figured out how to create a plugin to register custom post types and custom taxonomies rather than even using ACF (although I'm not sure which route is better: to use ACF or to just register custom post types and taxonomies via a plugin. Anyone have any thoughts on which route is better?). I've found documentation on how to add the custom taxonomies to a template and creating a custom-post-type index page, but I can't figure out how to do this within the Genesis framework. Can someone point me to any resources that helps me integrate the custom post types and custom taxonomies onto the actual templates/pages? Thanks!
April 8, 2015 at 4:26 pm #147122jayhleeMemberThanks for the recommendation. Are there any demos on how this all plays out? Given that I'm new to this all, I'm a little lost at sea with CMB2, what it does, and how it all works. My apologies for my greenness to this all!
April 8, 2015 at 5:47 pm #147128Brad DaltonParticipantTry this tutorial for CPT's http://wpsites.net/web-design/add-custom-post-type/
And this for custom fields and meta boxes http://wpsites.net/web-design/add-custom-field-before-sidebar-on-any-post/
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.