Taxonomy Registration
Thetipo_hinchable taxonomy is registered in functions.php using the zalbi_register_taxonomies() function:
functions.php (lines 152-168)
Configuration Parameters
The unique identifier for this taxonomy
Associates this taxonomy with the hinchable post type
Display labels for the taxonomy:
- name: “Tipos de Hinchable” (plural)
- singular_name: “Tipo de Hinchable” (singular)
- menu_name: “Tipos de Hinchable” (admin menu label)
CRUCIAL: Makes the taxonomy visible on the website. Without this, taxonomy archives won’t be accessible.
Enables category-style hierarchy with checkbox selection (like categories). When
false, behaves like tags.CRUCIAL: Displays the taxonomy in the WordPress admin interface
Shows a “Tipos de Hinchable” column in the Hinchables list view for quick reference
CRUCIAL: Enables the taxonomy in the Gutenberg block editor. Required for the taxonomy to work with the modern WordPress editor.
URL slug for taxonomy archives. Archives will be at
/tipo/term-name/Creating Tipos de Hinchable
Add New Type
On the left side of the screen:
- Name: Display name (e.g., “Castillos Hinchables”)
- Slug: URL-friendly version (e.g., “castillos”)
- Description: Optional description of this type
Organize Hierarchy (Optional)
Since
hierarchical is true, you can create parent-child relationships:- Parent: “Hinchables Acuáticos”
- Child: “Toboganes de Agua”
- Child: “Piscinas Hinchables”
Common Tipo Examples
Here are typical categories you might create:- Castillos - Traditional bounce castles
- Toboganes - Inflatable slides
- Hinchables Acuáticos - Water inflatables
- Pistas Americanas - Obstacle courses
- Juegos Interactivos - Interactive games
- Combos - Combination units (castle + slide)
- Hinchables para Adultos - Adult-sized inflatables
- Temáticos - Themed inflatables (princesses, superheroes, etc.)
URL Structure
Taxonomy archive pages use the/tipo/ slug:
Assigning Types to Hinchables
In the Admin
When editing a hinchable:- Look for the Tipos de Hinchable meta box (usually on the right sidebar)
- Check the appropriate types (multiple selections allowed)
- Update or publish the post
The
show_admin_column setting displays the assigned types in the Hinchables list view, making it easy to see which types are assigned at a glance.Programmatically
Querying by Taxonomy
Get Hinchables of a Specific Type
Multiple Types (OR)
Multiple Types (AND)
Taxonomy Archive Template
WordPress looks for templates in this order:taxonomy-tipo_hinchable-{term-slug}.php- Specific term templatetaxonomy-tipo_hinchable.php- General tipo_hinchable templatetaxonomy.php- Generic taxonomy templatearchive.php- Generic archive templateindex.php- Ultimate fallback
Example: taxonomy-tipo_hinchable.php
Getting Taxonomy Information
Get All Terms
Get Terms for a Hinchable
Count Hinchables in a Type
Filter Navigation Example
Create a filter menu for your catalog:Block Editor Integration
The
show_in_rest parameter is crucial for Gutenberg support. Without it, the taxonomy won’t appear in the block editor.- The taxonomy appears in the right sidebar under Document settings
- Users can check multiple types
- Hierarchical display shows parent-child relationships
- Real-time search for large taxonomy lists
Admin Column Display
Theshow_admin_column setting adds a column to the Hinchables list:
Best Practices
Plan Your Hierarchy
Before creating terms, plan your categorization structure. Too many levels can confuse users; too few limits filtering options.
Use Descriptive Slugs
Slugs appear in URLs, so make them SEO-friendly:
- Good:
castillos,toboganes-acuaticos - Bad:
tipo1,categoria-a
Add Descriptions
Term descriptions can be displayed on archive pages and help with SEO. Describe what types of hinchables belong in each category.