In this tutorial I create simple button shortcode with three attributes:
  • url
  • target
  • background
Put this code in your functions.php file
Wordpress
By the same principle, you can add attributes to an array and display them in a shortcode. Now set the CSS styles for the button
CSS
The button is ready, to output it add this shortcode in text editor:
[btn_big url="http://keksus.com/"]Sample button[/btn_big]
Only change the link to the one you need. If you want open link in a new window, add the attribute target="_blank" to shortcode:
[btn_big url="http://keksus.com/" target="_blank"]Sample button[/btn_big]
If you want change button background color, add the attribute background="#000" to shortcode:
[btn_big url="http://keksus.com/" target="_blank" background="#000"]Sample button[/btn_big]

Demo

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn