Category description in wordpress and display in front page344

Author: InfoBeep - August 3, 2017 | subject to copyright

Category descriptions help user to find content and helps your page to grow SEO rank. In this article, we will guide you to display category descriptions in your WordPress.

Adding category descriptions in WordPress

WordPress contains 2 inbuilt taxonomies called categories and tags which allow you to sort your content into different topics.

Now to add category descriptions in WordPress, follow the steps below:

  1. Go to Posts > Categories. Here you can directly enter a new category, with the description then click ‘Add new category’ button. If you add a description to an existing category, then click on ‘edit’ link in the category as shown in the demo picture below.
  2. After you click on the edit link, it will take you to the next page where you can fill the details as shown in the picture below:
  3. After done, make sure you click on the ‘Update’ button to save changes.

Display categoRy description on category archive page

Generally, themes in WordPress automatically displays the category description on the category archive pages but if your theme doesn’t then you may need to follow the steps below:

  1. Connect to the WordPress site using FTP client and then go to /wp-content/themes/your-current-theme/folder.
  2. Now you need to edit category.php file. If not available, edit archive.php file. Paste the code below
  3. Now save changes and upload the file on the website.

Display Category Description in WordPress Theme

  • Display category description in other parts of your website

Demo code:

echo category_description(3);

(Note: replace 3 with your own category ID)

  • Display category description inside a single post

Demo code:

$catID = get_the_category();
echo category_description( $catID[0] );

(Note: this code gets all categories for the current post and then outputs the category description of the first category)

  • List all your WordPress categories with a description in list format

Now, you can use

[wpb_categories]

in your post or pages. You need to enable shortcodes for widgets to use this shortcode inside a text widget: