YouTube
The YouTube shortcode for WordPress can be used to embed a video into a page or post. The shortcode comes with several settings like video width, autoplay, mute or alignment. Check below for example implementations and shortcode documentation:
YouTube Examples
YouTube Shortcodes
YouTube Shortcode
[x3m-youtube url="https://www.youtube.com/watch?v=ekr2nIex040" width="100%" autoplay="no" align="" mute="no"]YouTube Documentation
Here are the shortcode option settings available for YouTube:
| Shortcode Settings | Details |
|---|---|
| url=”youtube link” | This is used to set link of the Youtube video. |
| maxwidth=”100%” | This is used to define the maximum width of the Youtube video container in percentage (ex “100%”). |
| autoplay=”yes” | This is used to set video to start playing on page load or not. To automatically start playing, set the autoplay option to “yes”. The other option is “no”. |
| align=”center” | This is used to set the video container alignment. For the cases when the video width is lower than that of the page, the video can be aligned “left”, “center” or “right”. |
| mute=”no” | This is used to set video sound to be on or off. Options available: “yes” or “no”.
If autoplay=”yes”, the mute option should be set to “yes” as well, otherwise the video playback will not start automatically. |