WP-Mix

A fresh mix of code snippets and tutorials

Create a WordPress shortcode

Creating your own custom shortcodes is another thing that WordPress makes very easy to do.

Add this to your theme’s functions.php file:

function i_love_you() {
	return 'I love you.';
}
add_shortcode('luv', 'i_love_you');

Then to show some love anywhere in your posts or pages, just type the following shortcode:

[luv]

Much more is possible, visit the WordPress Codex for more infos.

Learn more

Digging Into WordPressWordPress Themes In DepthWizard’s SQL Recipes for WordPress