Enable Extra Icon

The Enable Extra Icon tool allows you to add custom icons to categories, tags, posts, and pages. You can assign an image URL or use an icon class (e.g., from an icon font).

The icon can then be displayed dynamically in your templates using helper functions.


🔧 How It Works

  • For taxonomies (categories/tags):
    wpc_get_icon('tax', $tax_id);
  • For posts/pages:
      wpc_get_icon('post', $post_id);

The function wpc_get_icon returns:

  • <img> HTML if an image URL is used.
  • <span class="f-icon fi-wpcoder _color-primary"></span> if an icon class is used.

Usage Examples

On taxonomy page:

<?php echo wpc_get_icon('tax', get_queried_object_id()); ?>

On page or post:

<?php echo wpc_get_icon('post', get_the_ID()); ?>

Add Icon to Category
Add Icon to Category

PHP Code Example
PHP code to get Icon of the category

HTML Code Output
HTML Code for Category Icon