When building a WordPress website — especially a custom one — it’s easy to get confused about how content is structured. Many people mix up post types, taxonomies, and categories, but once you understand the difference, it becomes much easier to organise and manage your content effectively.
Post Types: Defining Content Nature – “What kind of content is this?”
Post types define what kind of content you’re creating. WordPress comes with some built-in types, and you can also create your own.
Examples:
post
– for blog postspage
– for static pagesproduct
– WooCommerce productsproject
,partner
,case_study
– custom post types for your own site
Think of post types as containers that hold specific kinds of content. Each post type can have its own set of attributes, templates, and functionalities, catering to diverse content needs.
Taxonomies: Categorising Content – “How can we group or classify this content?”
A taxonomy is a system used to group or classify posts. WordPress includes two by default:
category
– usually used for blog post topics
post_tag
– keywords or labels
You can also create your own, such as:
region
,industry
,sector
,service_type
Think of taxonomies as folders or labels that help organise your content within a post type.
Terms – “The actual values used in a taxonomy”
Terms are the individual labels within a taxonomy.
Examples:
If your taxonomy is category, a term might be Technology
If your taxonomy is region, a term might be Australia or Serbia
Terms are like tags or folders inside the system.
Organising Projects by Industry in WordPress – Real Example
WordPress’s default post types—’posts’ and ‘pages’—serve general purposes. However, when content doesn’t fit these molds, custom post types (CPTs) become invaluable. By creating a CPT named ‘Projects’, developers can distinctly manage project-related content, separating it from standard blog posts or pages.
Custom Taxonomies: Group Projects by ‘Industry’
While CPTs define the nature of content, taxonomies classify it. WordPress’s built-in taxonomies, ‘categories’ and ‘tags’.
Introducing a custom taxonomy named ‘Industry’ allows for grouping projects based on sectors like ‘Healthcare’, ‘Education’, or ‘Technology’. This hierarchical structure facilitates users in filtering and accessing projects pertinent to specific industries.
Visual Breakdown
Item | What It Is | Example Value |
---|---|---|
Post Type | Type of content | project |
Taxonomy | How you group that content | industry |
Term | The actual group label inside taxonomy | Healthcare, Education, Technology |
Implementing this structure involves registering the ‘Projects’ CPT and the ‘Industry’ taxonomy, then associating them. This setup not only organizes content efficiently but also improves SEO by creating meaningful URLs and enhancing site architecture.
Add this to your theme’s functions.php file or a custom plugin:
// Register Custom Post Type: Project
function register_project_post_type() {
$labels = [
'name' => 'Projects',
'singular_name' => 'Project',
'menu_name' => 'Projects',
'name_admin_bar' => 'Project',
'add_new' => 'Add New',
'add_new_item' => 'Add New Project',
'new_item' => 'New Project',
'edit_item' => 'Edit Project',
'view_item' => 'View Project',
'all_items' => 'All Projects',
'search_items' => 'Search Projects',
'not_found' => 'No projects found',
];
$args = [
'label' => 'Project',
'labels' => $labels,
'public' => true,
'has_archive' => true,
'rewrite' => ['slug' => 'projects'],
'supports' => ['title', 'editor', 'thumbnail'],
'menu_icon' => 'dashicons-portfolio',
'show_in_rest' => true, // for Gutenberg
];
register_post_type('project', $args);
}
add_action('init', 'register_project_post_type');
Register Custom Taxonomy: Industry
// Register Custom Taxonomy: Industry
function register_industry_taxonomy() {
$labels = [
'name' => 'Industries',
'singular_name' => 'Industry',
'search_items' => 'Search Industries',
'all_items' => 'All Industries',
'edit_item' => 'Edit Industry',
'update_item' => 'Update Industry',
'add_new_item' => 'Add New Industry',
'new_item_name' => 'New Industry Name',
'menu_name' => 'Industries',
];
$args = [
'labels' => $labels,
'hierarchical' => true, // like categories
'public' => true,
'rewrite' => ['slug' => 'industry'],
'show_in_rest' => true,
];
register_taxonomy('industry', ['project'], $args);
}
add_action('init', 'register_industry_taxonomy');
Result:
Your custom post type URL:
https://yourwebsite.com/projects/
Individual project URL:
https://yourwebsite.com/projects/project-name/
Industry taxonomy archive:
https://yourwebsite.com/industry/technology/
Then you need to create Front end code
archive-project.php or single-project.php template
Mastering the concepts of post types, taxonomies, and terms is fundamental for effectively managing and presenting content in WordPress.