WordPress introduced Shortcode API in version 2.5. Shortcode is a set of functions for creating macro codes. In our previous WordPress tutorial we have discussed about custom WordPress plugin creation. Now we will discuss how can you add extra functionality to your custom plugin. When a shortcode inserted into page or post, it is replaced with the other content. Means, we instruct WordPress to find the macro code under square brackets ([]) and replace it with the dynamic content. Shortcode is one of the most useful features in WordPress and you can use shortcode into post, page and plugin. The usage of shortcode is very easy and programming skills are not required. In this tutorial we will fetch recently added posts from the database and display using shortcode. Our shortcode will instruct how many post will be retrieved. Also it will be provide heading of the posts. A simple shortcode is look like this: [latestposts] Shortcode can be used with additional attributes as the following: [...