-
-
Save salcode/597ae93ac8e85f343570 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to use | |
[button link='http://linktosomething.com' color='orange']My Button Text![/button] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks Sal