WordPress Block Editor – Categories Block
This tutorial is part of our series on How To Use The WordPress Block Editor (Gutenberg).
- To learn more about using the WordPress block editor interface, go here: The WordPress Block Editor – Content Area
- To learn more about using blocks, see this tutorial: How To Use WordPress Block Editor Blocks
- For additional information, see this tutorial on How To Use Post Categories In WordPress.
Categories Block – Description
The Categories block organizes and displays your published posts as a list of categories. Use this block to provide your site visitors with a useful way to discover your related posts.
How To Use The Categories Block
In this section, we’ll cover:
- How to add a Categories block to your content.
- How to edit and configure your Categories block and block settings.
- How to remove the Categories block from your content.
For more details on using blocks (e.g. how to move blocks around your content), see this tutorial: How To Use Blocks.
Adding A Categories Block
To add a Categories block to your content:
- Use the tools in the Categories block Editor or Block Settings section to edit your category list.
Let’s go through the above steps.
First, create a new post or page or open an existing post or page and either:
Click on the ‘Add Block’ tool and select the Categories block…
Or, select a Categories block using the Inserter tool in the Content Area.
(Add a Categories Block from the Content Area)
After adding a Categories block, you can:
- Edit and configure the block settings,
- Save, publish, or update your post or page.
How To Edit A Categories block
To edit a Categories block:
- Click inside the Categories block to select it.
- Use the Block Editor tools to:
- Reposition the Categories block in your content using the Drag block tool and Move up and down arrows.
- Change the alignment of the categories list.
- Perform additional tasks using the More Options feature.
- Use the Block Settings to change category settings.
Use the Block Editor to change block alignment.
Use Block Settings to change category settings.
Remember to update and publish your post or page to save your settings.
How To Remove A Categories Block
To delete or remove a categories block:
- Click inside the Categories Block to select it.
- Select the ‘More Options’ tool in the Block Editor.
- Click on ‘Remove Block’.
- The block will be removed from your post or page.
- You can reposition your block using the ‘Move Up’ and ‘Move Down’ arrows or the Drag and Drop handle tool (see this tutorial if you need help with this step: How To Use Blocks).
- You can also convert Categories blocks into Reusable blocks.
Categories Block Tools, Options & Settings
The Categories block includes tools, options, and settings for:
- Categories Block Editor
- Categories Block Settings
Categories Block Editor
The Categories block editor includes tools that let you perform the following operations:
- Change block type or style (See ‘Categories Block – Additional Info’ section below.)
- Drag block
- Move block up and down
- Change alignment:
- Align left
- Align center
- Align right
- Wide width – makes the block stick out on either side of regular content.
- Full width – makes the block stretch over the entire width of the browser window (regular content remains within margins on either side).
- More Options – See How To Use Blocks to learn how to use this section.
Categories Block Settings
Categories block settings include:
- Block description area
- Categories Settings
- Display as Dropdown – Converts a list of categories into a single-line dropdown menu.
- Show Hierarchy – Display categories nested in a parent/child hierarchy.
- Show Post Counts – Displays the number of posts included under each category.
- Advanced Settings
- Additional CSS Class(es) – This field lets you add multiple CSS classes to your block separated with spaces. This allows you to write custom CSS and style the block as you see fit. Note: This requires having knowledge of CSS (Cascading Style Sheets).
Categories Block – Additional Info
The Categories block can be converted into the following block types:
Congratulations! Now you know how to use the WordPress content editor’s Categories block.
- To learn more about using categories, go here: Using WordPress Categories
- For tutorials on how to use other blocks, go here: WordPress Block Editor – How To Use Blocks