Skip to content
Custom fields for WordPress that are quick to build and quick to load. Get Pro

Media and content

IconPro

Pick an icon from a grid: WordPress icons or the icon files of your theme.

When to use it. One icon from a set: a service icon, a social network, a feature.

What the editor sees. A grid of icons with a search box.

The Icon field on an edit screen
The Icon field on an edit screen.
Name in files and code icon_picker
ugly_get() gives The file name, the URL or [ 'name', 'url', 'kind' ].
Behavior can be required; can share a line with other fields

Settings

Setting What it does Default
Where the icons come from folder
Folder inside the theme For example assets/icons. Every .svg, .png and .webp file in it is offered. assets/icons
What the code receives Choices: {'value': 'value', 'label': 'The name (file name or dashicon class)'}, {'value': 'url', 'label': 'The address of the file (folder icons)'}, {'value': 'array', 'label': 'A list: name, address and kind'}. value

In your theme

PHP
$icon = ugly_get( 'icon' );   // return format: array

if ( $icon ) : ?>
	<img src="<?php echo esc_url( $icon['url'] ); ?>" alt="" width="32" height="32">
<?php endif;

Good to know

  • Where the icons come from: the Dashicons of WordPress, or a folder of your theme with SVG files.
  • With What the code receives set to value you get the name or file, with url the address, with array both and its kind.