Add Shortcode to WordPress


13 May 2014 Author

A Shortcode is a simple way to add macro code to WordPress post and pages through editor. You can create your own, with your code in function.php file.

You simply add:

function foobar_func( $atts ){
	/* Your code here */
add_shortcode( 'foobar', 'foobar_func' );

to functions.php file and this will work with [foobar] shortcode!
More about this here



Comments are closed.