HostPapa Explains: WordPress shortcodes

Shortcodes in WordPress are bits of code that help you do certain things very easily. They started to function in WordPress 2.5 and made it very convenient to execute code inside WordPress pages, widgets, and posts without writing any actual code. 

You can use it to embed files or to create objects that would usually need a lot of coding knowledge. For example, you can embed a video with this shortcode:

[ video ]

You can also add attributes, the next one is an example of the video shortcode with an src attribute:

[video src="video-source.avi"]

WordPress has shortcodes for audio, caption, embed, video, and gallery. You can add other shortcodes with the Shortcode API plugin. 

If you want to use the text of a shortcode in a post, you will need to use double brackets. So, if you want to display the text of the code instead of the actual video, you would need to use the shortcode with double square brackets:

[video]

Shortcodes are an easy option to add features to your WordPress site. Without them, adding galleries, videos, and other functions would require a lot of code editing.

Shortcodes add HTML and other markups dynamically directly where you want them to show.

If you need help with your HostPapa account, please open a support ticket from your dashboard.

Related Articles

Get online with our affordable web hosting

Get online with our affordable web hosting

Learn more now
HostPapa Mustache