Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Marius V
Marius V
9,043 Points

Whats the best practice when coding a "team site" in wordpress?

Hi Guys, I got a question regarding wordpress. I use wordpress as a CMS for all of my client work, because it's so easy to use even for very untrained people (like my clients).

But I wonder what are the best practices when coding for example a "team page"? Many of my clients are medical offices or lawyers and stuff and they usually have a team page.

What's the best way to code this? Should I go full static (no real "dynamic", generated by wordpress content), which would have the advantage that I can fully control the layout but that's very unflexible for my client because I need to change everything for them (and that's not really the point of using a CMS). Or should I just provide a basic template where they can edit the team page (or every other static page) by editing the page with no real structure provided? This has the disadvantage that often the layout is very crappy because they don't know (of course) how to layout the site properly.

A thing I thought about would be to use custom post types and custom taxonomies for the team, so that they can change the team by adding a custom post type to wordpress. I could still control the layout pretty well and it would be still pretty flexible for my clients.

Is this how it is usually done professionally?

That's a thing I'm also asking myself with every static page that I have. How can I handle it, that my clients don't mess up the layout when I'm not controlling everything.

2 Answers

Tammy Hart
Tammy Hart
2,819 Points

Hi Marius,

Your plan to use CPT and Taxonomies is the standard way of managing a team page; it's how all the agencies and freelancers I know handle it. The only other tool available is the users API, but that requires them to be registered subscribers or higher of the site, and that is probably unnecessary.

I would also suggest taking a look at Advanced Custom Fields plugin, as it makes it really easy to add sleek custom meta boxes specific to CPTs.

Marius V
Marius V
9,043 Points

Thank You :)

Exactly what I was hoping for :)

So basically you'll use Custom Post Types for like everything that needs a certain layout structure. Another example: If I want to display certain services my clients offer, do I just create a CPT and a special Template for it and my clients are then able to create the actual service descriptions on their own?

Tammy Hart
Tammy Hart
2,819 Points

yeah, especially if they need to have their own single view pages. Another method is to use a plugin like Advanced Custom fields Repeater and/or Flexible Content Areas. You can set which inputs need to be filled out for each item, then keep adding as many as you need. Super easy to output the results, and the interface is easy for the client to use.

Marius V
Marius V
9,043 Points

Thank you :) The ACF plugin is really nuts. I now worked with the "Types" plugin but I'm not really convinced of it.