The Newspack theme uses Yoast’s Primary Category to let you display only one category with single posts and blocks. It is on by default when the Yoast plugin is enabled.
Using the Primary Category
Yoast’s Primary Category functionality allows you to pick a specific category that will show, alone, on single posts and the Homepage Posts block. This way, you can categorize your posts under numerous categories for taxonomy purposes, but only display one on the front-end.
Follow these steps to pick a primary category:
- When editing a post, when you select more than one category, a dropdown will appear labelled Select the primary category.
- Pick the category that you would like to display on single posts and blocks.
- Click Publish.
Now the category you selected will be the only one that shows on the front-end for the post:
Overriding the primary category
The Newspack Theme includes an option to override Yoast’s primary category on single posts, to display all categories. To enable this, follow these steps:
- Navigate to Customizer > Template Settings.
- Uncheck Use Yoast’s primary category functionality.
- Click Publish.
Now your posts will display all of your selected categories in alphabetical order:
The Homepage Posts Block and Post Carousel Block will always display only one category — if Yoast is disabled, they will display the first selected category. This is to avoid display issues — unlike single posts, the blocks may not always have enough space to display multiple categories.
Yoast Primary Category
- Post Settings
- Author Bios
- Date Options
- Post Formats
- Previous and Next links
- Yoast Primary Category
Theme Table of Contents