Home › Forums › General Issues › Post Object help › Reply To: Post Object help
WordPress handles a lot of this for you automatically.
For your Leadership page that could be the archive template for your Employee custom post type – http://codex.wordpress.org/Template_Hierarchy#Custom_Post_Type_Archive_display
You can say whether or not a custom post type has an archive, and what the URL should be when register the custom post type: http://codex.wordpress.org/Post_Types#URLs_of_Namespaced_Custom_Post_Types_Identifiers
So if you set your custom post type slug to “employees” and go to http://www.example.com/employees it will use the archive template automatically.
Otherwise you could create a shortcode that does a get_posts
on your employee custom post type and display it anywhere.
For your individual employee pages these are automatically created as well, and use the template: http://codex.wordpress.org/Template_Hierarchy#Single_Post_display
So in your single employee template you’ll just need to call get_field
or the_field
as normal and it will output the values for that specific employee. No need to create a new page and assign employees, as once you’ve created a new employee post it will automatically use this page.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
Accordions are a great way to group related information while allowing users to interactively show and hide content. In this video, Damon Cook goes in-depth on how to create an accessible accordion block using ACF PRO’s Repeater field.https://t.co/RXT0g25akN
— Advanced Custom Fields (@wp_acf) March 2, 2023
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.