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 trialJames Barrett
13,253 PointsOne way to determine if WordPress should be used is if it 'can manage your content' What exactly does this mean?
Might sound a bit silly but I can't quite grasp what Zac is trying to say here. When would it not be possible to manage content on a site using WordPress?
If possible provide a couple of examples so I can properly grasp it!
Thanks, James.
1 Answer
Kevin Korte
28,149 PointsWordpress is highly opinionated, so while it can be a good management system for a lot of websites, it may not be a great choice for others.
Lets say, you wanted to build a website to provide a custom service to clients, maybe (cause there isn't enough of them) a website that lets users create their own todo lists. Wordpress probably wouldn't be a good choice here.
We just went through this recently with a new website for a local home builder. While most of their competition does use wordpress, we've decided to go a full custom node.js management system because of the additional content and features that want to be added now and down the road.
James Barrett
13,253 PointsJames Barrett
13,253 PointsSo would I be right in saying that WordPress would rarely (or ever) be used in web applications due to the complexity that is likely to come with building them (like the example you provided about the to-do lists)? The way I look at WordPress is that it should be utilised for websites that have LOTS of content. Especially duplicated content like blogs, shopping items, etc? Also, what does Zac mean when he speaks about 'Custom Post Types and Custom Fields'. No idea what he is talking about here!
Thanks Kevin.
Kevin Korte
28,149 PointsKevin Korte
28,149 PointsYou're more or less right. It's not so much about the quantity of content, but it's about the type of content. Wordpress can handle heavy content sites, some of the biggest blogs you and I read are wordpress in the background, but it can also do small, simple, light content sites as well.
The issue that arises with wordpress is more or less that the database schema is set, by wordpress. Now, you can add custom tables and fields to your wordpress site, to design your own schema to meet your own goals, but you start to walk a dangerous line of updating, backing up (will wordpress backup tools catch the extra table/schema you added), etc. You get to a point where you're contorting wordpress to do something it wasn't designed to, and you would have been better off building from scratch, or a less opinionated framework.
Wordpress is great for storing content, and than displaying that content to a user, in a way you want it to, with it's easy themeable layout. It's also great at separating content from markup, making it easy to update or change the style.
Wordpress stores more or less all of the content into one table, the posts table. Content you store in a "page" is actually stored in the posts table, with a post type of page. Regular posts are also stored in the post table with a post type of post. There is a column in the wp database to store the post type.
Custom post types are what they sound like, they're custom, but they will be default behave like a post. Let say I wanted to show off my real estate portfolio, I could have a custom post type called "apartments", once called "residential", and one called "commercial". All 3 of these post types will be saved in the posts database table, but the post type will be apartments, residential, or commercial, respectively. Why would I do this, well, I could add custom fields (more on this later), I can separate the types of real estate in my admin dashboard for cleanliness, I also get the opportunity if I wanted to my theme to show this information differently, I can change up some of my template views for the post type to reflect what I want. Now I have access to
single-apartments.php
,single-residential.php
andsingle-commercial.php
in my theme template files - yay!Custom fields are a way to add additional data to a post type. Sticking with our example, lets say for our apartments, we want to add a custom field that is date selector, to allow us to show on what date apartment is available, well I can do that. And commercial properties, residential properties, and regular posts won't have that same custom field, it stays scoped to it's assigned post type. Which means I could add more custom fields to my other post types, and each post types can have basically an unlimited amount of custom fields, yay!
In short (or long), that's more or less a fly by.
James Barrett
13,253 PointsJames Barrett
13,253 PointsAwesome, thanks a lot for the comments Kevin, that has really helped out. The impression I get from custom posts and fields is that it's essentially a post, however you customize it to your needs. This will be beneficial as we won't be limited to the default WordPress fields that we are already assigned in the 'Posts' category.
Thanks again, James.