WordPress shortcodes can be used within your page or post content which invokes a specific function which inserts content at the position of where you inserted the shortcode. Uses for shortcodes are endless, from inserting media content and galleries, to social media like and share buttons, showing lists of recent or related posts, and so on.
Many WordPress themes and plugins will add new shortcodes for you to use, but at times you may wish to add your own custom shortcodes which aren’t already available. Fortunately, WordPress makes developing your own an easy task for anyone who is familiar with WordPress and has basic PHP skills.
Here I’ll show you the basics of how to develop your own custom WordPress shortcode. We might as well make it do something practical, so we will create a shortcode that inserts a Google+ +1 button. These neat little +1 buttons allow your site’s visitors recommend your site in Google search, and share via the Google+ social media platform.