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
![]()
PHP Code Example
![]()
HTML Code Output
![]()