Skip to content

Instantly share code, notes, and snippets.

@toddmotto
Last active December 11, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toddmotto/4613107 to your computer and use it in GitHub Desktop.
Save toddmotto/4613107 to your computer and use it in GitHub Desktop.
WordPress shortcode for H tags.
// Headings
function heading( $atts )
{
extract(shortcode_atts(array(
'tag' => '',
'text' => '',
), $atts));
return '<h' . $tag . '>' . $text . '</h' . $tag . '>';
}
add_shortcode('heading', 'heading');
@toddmotto
Copy link
Author

You can use these in the dashboard editor 'Visual' Panel like so:
[heading tag="1" text="H1 Tag"]
[heading tag="2" text="H2 Tag"]
[heading tag="3" text="H3 Tag"]
... And so on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment