Using the Icon Shortcode with Links

· 2 min read

The Hugo FortyTen theme includes a convenient icon shortcode that makes it easy to insert Ionicons anywhere in your content. This shortcode supports linking, sizing, and accessibility attributes.

Basic Usage

To insert an icon, use the shortcode with the name parameter:


  


This will render a heart icon in your post.

You can make an icon clickable by adding the link parameter:

By default, links open in the current window. No additional configuration needed.

To open a link in a new tab or window, use the target parameter:

Sizing Icons

Control the icon size with the size parameter. Available sizes are small, large, and default:


  



  


Accessibility

Add descriptive labels for screen readers with the aria-label parameter:


  


Hide icons from screen readers when they’re purely decorative using aria-hidden:


  


Complete Example

Combining multiple parameters:

Available Icons

Browse all available Ionicons at https://ionic.io/ionicons. You can search by name and preview each icon’s appearance.

Parameters

Parameter Required Description
name Yes The name of the icon (e.g., heart, star, menu)
size No Icon size: small, large, or omit for default
link No URL to link to
target No Link target: _blank, _self, etc. (defaults to current window)
aria-label No Accessible label for screen readers
aria-hidden No Set to true to hide from screen readers
Author avatar

Your Name

A brief author biography or tagline.

You may also like