The basic purpose of using a shortcode is to replace the placeholder with your very own custom snippet of HTML. This powerful function allows you to customise the layout of posts, insert different types of buttons or media and even snippets of HTML. It doesn't take an experienced wordpress developer to implement shortcodes, with just a few simple shortcodes you'll soon be on your way.
A basic wordpress shortcode consists of a simple function in which we insert inside of the "Functions.PHP" file. The function can be inserted anywhere at the bottom of the functions file, this is probably best practice as the function file more than likely contains a mountain of PHP code anyway.
On my tutorial blogs i have a number of shortcodes one of which is a simple little text box for containing tips. On Code-Snippet it looks like this.
This is my shortcode box for writing tips.
To display this in shortcode, in our wordpress post we would simply add the following snippet.
When viewing the post live on the website the shortcode snippet will be replaced with the HTML code inside of our function.
WordPress shortcodes can be used in many many ways, this tutorial is just one simple demonstration of a shortcode. In a later tutorial we'll be talking about passing arguments to functions. If you can;t wait that long maybe give the wordpress Shortcode API Codex a try.