Do you want to display category descriptions on your WordPress site? Categories allow you to easily sort content on your website. They also help users easily find content and are good for SEO. In this article, we will show you how to easily display category descriptions in WordPress.
Adding Category Descriptions in WordPress
WordPress comes with two built-in taxonomies called categories and tags. These taxonomies allow you to easily sort your content into different topics.
When used correctly, categories and tags can also be very helpful in improving your WordPress SEO.
WordPress allows you to add descriptions for your categories. However, many users don’t notice it because they create categories when writing a post which doesn’t let them add description.
Here is how to easily add description to your categories.
Head over to Posts » Categories page. If you are creating a new category, then you can simply enter category name and description here and then click on ‘Add new category’ button.
If you want to add description to an existing category, then you need to click on the ‘Edit’ link below that category.
This will take you to category edit screen where you can add description for your category.
Don’t forget to click on the ‘Update’ button to save your changes.
Repeat the process to add descriptions to all your categories. You can use the same method to add descriptions for tags as well.
Display Category Description on Category Archive Page
Most WordPress themes will automatically display the category description on the category archive pages.
However if your theme does not display category description on archive pages, then you will need to edit your theme files.
Connect to your WordPress site using an FTP client and then go to /wp-content/themes/your-current-theme/ folder.
Now you will need to locate and edit category.php file. If your theme doesn’t have category.php file, then you will need to edit archive.php file.
Copy and paste this code where you would like the category description to be displayed.
You can now save your changes and upload the file back to your website.
After that, you can visit the category archive page on your website to see the description in action.
Display Category Description in WordPress Theme
If you want to display the category description in other parts of your website, then you can also use the category_description template tag:
Don’t forget to replace 3 with your own category ID.
If you want to display category description inside a single post, then you can use this code.
This code simply gets all categories for the current post and then outputs the category description of the first category.
If you would like to list all your WordPress categories with a description in list format, then you can add this code in your theme’s functions.php file:
This code creates a shortcode which displays all your categories and their descriptions in a plain list.
You can now use [wpb_categories] in your posts and pages. To use this shortcode inside a text widget, you will need to enable shortcodes for widgets.
We hope this article helped you learn how to add and display category descriptions in WordPress.