Skip to content

Instantly share code, notes, and snippets.

@salcode
Forked from lepittenger/README.txt
Created March 10, 2015 00:02
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 salcode/597ae93ac8e85f343570 to your computer and use it in GitHub Desktop.
Save salcode/597ae93ac8e85f343570 to your computer and use it in GitHub Desktop.
How to use
[button link='http://linktosomething.com' color='orange']My Button Text![/button]
<?php
function mytheme_button($atts, $content = null) {
$atts = shortcode_atts(array('link' => '#', 'color' => '#'), $atts);
return '<a class="button ' . $atts['color'] . '" href="' . $atts['link'] . '">' . do_shortcode($content) . '</a>';
}
add_shortcode('button', 'mytheme_button');
@lepittenger
Copy link

Thanks Sal

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