What is shortcode
ShortCode is term used in wordpress . Short Code is built in feature in wordpress . Short codes are introduced in wordpress 2.5 version . These are used to creating macros for used in posts or pages .
In wordpress user can’t and any function or any php code in between the post or the page .
For example you want to add two text boxes and a submit button in specific post or page . You want that ,when user click on submit button ,then both text boxes values are added . Add sum of these values are display in message box .
To user this submit button you need to “onclick()” . But problem is that by default you can’t use onclick() between specific post or page . Short code solve this problem . User add this onclick function in post using a short code .
How shortcode works
By default WordPress trim the php codes and functions from pages or posts . When user try to add php code in post or page , code is filtered from it or commented out .
With shortcode , user add php code in function.php file or plugin and paste this shortcode keyword in the page where user want to insert this php code .
For more details about shortcodes see this link.
Short code syntax is [ ShortcodeName ] . It starts with angle bracket ” [ “then short code “name” and “] “angle bracket close .