Example blurb shortcode
Example blurb shortcode with enclosed content and optional attributes (icon and href)
// Add Shortcode function proaudit_blurb( $atts , $content = null ) { // Attributes $atts = shortcode_atts( array( 'icon' => '', 'href' => '', ), $atts, 'blurb' ); $text = '<div class="blurb">'; if (!empty($atts['href'])) $text .= '<a class="blurb-link" href="'.$atts['href'].'">'; if (!empty($atts['icon'])) $text .= '<span class="blurb-icon '.$atts['icon'].'"></span>'; $text .= '<span class="blurb-content">'.$content.'</span>'; if (!empty($atts['href'])) $text .= '</a>'; $text .= '</div>'; return $text; } add_shortcode( 'blurb', 'proaudit_blurb' );