January 03rd, 2024

What are the shortcodes in WordPress?



Shortcodes are a special tag that you add to your post, while viewing the post in the website, it gets replaced with other content.

For example, if someone adds [simple_wptree] of wp plugin to the post, then instead of that shortcode, the visitor sees the sitemap in the post of the website. Here the shortcode is replaced by the predetermined content.

Likes (2) Comments (2)



2 Comments Add Your Comment


Balvinder Singh
3 years ago Selected
Let say we installed a plugin, and want to use in sidebar. So one way is to add code for same, but not all can do. Instead there is a short code, which internally contains the code. So, instead of writing the whole code, we add a short code.
One such example I use for embedding read more links on tekraze.com is by using notes widget. Example below

[su_note] Hello, I am a note[/su_note]

So, if we add this to the Wordpress editor, or text editor widget, we can render the note design having our text message. Same way several plugins do provide shortcodes, for quickly integrating functionality to any Wordpress site area like, sidebar or footer.

Thanks
Like (1) Reply
In WordPress, shortcodes are a type of macro code that allows you to perform a specific function or display specific content in a post or page by using a simple code, often enclosed in square brackets [].

Some examples of built-in shortcodes in WordPress are:

[gallery] - This shortcode allows you to display a gallery of images in a post or page.

[audio] - This shortcode allows you to embed audio files in a post or page.

[video] - This shortcode allows you to embed video files in a post or page.

[caption] - This shortcode allows you to add captions to images, videos and audio files.

[wp_caption] - This shortcode allows you to add captions to images, videos and audio files, with more options.

[embed] - This shortcode allows you to embed content from external sites, such as YouTube videos, Twitter posts, and more.

[shortcode] - This shortcode allows you to run other shortcodes inside a post or page.

There are many more shortcodes that you can use, some are provided by WordPress core, others are provided by plugins. Shortcodes can also be created by developers, to perform specific functionality or display custom content.
Like (1) Reply

Post a Comment

To leave a comment, please Login or Register