how to create shortcode and use in wordpress

Hello friends, in wordpress site you can see in so many plugins and so many slider plugin you can see wherever you want to add that code you have to add that shortcode, so same thing i will show you that how you can also create shortcode in wordpress and how to use in wordpress site.

suppose normally in wordpress we have to display so many places current site url and current template url so for that we normally used something like

for getting site url in wordpress we use like:

and for getting current installed theme url we use like:

and while developing in so many pages we need this above two functions or any other function that you repetedly used in your site for that you can create shortcode for that , so for that i will show you how to create and used in wordpress site

for creating shortcode just write something like below code

for use in any pages of wordpress or post you can access something like

so create like this shortcode for which function you used in your project repeatedly so, it will increase your script execution and also save your time to type same function again and again in your site.