// Add Shortcode function output_icon_code( $atts ) { // Attributes $atts = shortcode_atts( array( 'icon' => 'plus', 'position' => 'left', ), ); if ( isset( $icon ) ) { return '<span class="icon-' . $icon . ' position-' . $position . '"></span>'; } } add_shortcode( 'icomoon', 'output_icon_code' );