Marsha Docs

About Shortcodes

Shortcodes are a feature that allows for WordPress administrators to easily add components to their pages without having to understand HTML, CSS, PHP, JavaScript, or any programming language.

A shortcode is written inside two square brackets. For example, the [efsalert] shortcode can be used to add an alert to any page or post.

Some shortcodes require an opening and closing shortcode, with content in between. For example:

[efsalert]This is my alert[/efsalert]

Some shortcodes also have parameters that can be passed through, some are optional and some are required. For example, if we wanted a green alert instead of the default alert:

[efsalert type="green"]This is my alert[/efsalert]

You can learn more about the example used here by visiting the documentation page for alerts.