外掛標籤
開發者團隊
原文外掛簡介
Taxonomy Icons adds an icon picker to the term edit screen of categories and of any other public taxonomy. The icons come from the WordPress Icons registry, the same source as the core Icon block. You can also turn on extra icon sets.
Show the icons with the two included blocks, with the matching Elementor widgets, or with template functions in your theme. The plugin is compatible with Elementor.
Features
Icon selector on the term edit screen of each enabled taxonomy.
Settings page to choose which taxonomies support icons.
Optional extra icon sets: Phosphor, Tabler (filled and outline) and Material (filled and outline).
Categories with icons block: shows the terms of the current post, for any post type and any taxonomy chosen in the block settings. Works inside a Query Loop.
Categories list with icons block: lists all terms of a taxonomy, with options to show post counts, show only top-level terms, include empty terms and exclude specific terms.
Both blocks can show the icon, the name or both, with settings for icon width and icon color.
Supports color, typography, spacing and border settings.
Compatible with Elementor: both blocks are also available as Elementor widgets. They work in Elementor loop items.
Translation ready.
Template functions
codemcti_get_category_icon( $term = null, $args = array() )
Returns the SVG markup of the icon assigned to a term, or an empty string. $term is a term object or ID and defaults to the queried term. $args accepts size (pixels, default 24), class and label (an empty label marks the icon as decorative).
codemcti_the_category_icon( $term = null, $args = array() )
Prints the icon. Takes the same arguments.
codemcti_get_category_icon_name( $term = null )
Returns the registered icon name, for example core/star-filled.
Filters
codemcti_taxonomies: filters the taxonomies that support icons.
codemcti_available_icon_sets: filters the extra icon sets offered on the settings page.
Credits
Phosphor Icons: https://phosphoricons.com/ (MIT License)
Tabler Icons: https://tabler.io/icons (MIT License)
Material Symbols: https://fonts.google.com/icons (Apache License 2.0)
