What is a shortcode?

What is a shortcode?

A shortcode is a functional tag which you place in and around your text to make things happen on the web page which text alone cannot do. HTML is a language used for adding richness like color, boldness and size. Shortcodes may be mixed with HTML , JavaScript and PHP or used alone with text by the web programmer(you) to create dynamic pages with an ease never known before.

You can make shortcodes do things as simple as making the text bold to more complex tasks like creating forms, text boxes and also to write the commands to collect and process the input in various ways while displaying it all inside your favorite template or any existing website theme.

You may even define your own custom shortcodes to simply repetitive processes and save lots of typing.

The list of available shortcodes is fairly comprehensive, including direct server file access, conventional “if/else” logic, standard looping structures like, foreach and while as well as full access to querystring, form input, cookies, request headers and all other standard server variables you would expect to see.

The shortcodes are ultimately compiled as PHP , HTML or JavaScript(as required) directly into index.html or index.php files located at the nodes’ actual internet addresses. The shortcodes may be mixed directly with PHP code before node compilation. Shortcode variables such as ‘var1’ translate in PHP to ‘$var1’. Some shortcodes such as all user defined shortcodes, if and while require their conditional logic expression variables be in PHP form. These will be noted in the examples.

Think of using shortcodes as training wheels that will give you the basic understanding of internet programming, web design and codebase management. They are in no way intended as a replacement for the very robust PHP language and it is our hopes that you will be inspired to further your skills by studying PHP, HTML and JavaScript with our advanced courses.




Leave a Reply