Embedding a Video in a Template File

Adding shortcodes to template files is a bit tricky. Although [ embed]myvideourl[ /embed] looks like a regular WP shortcode, it’s not handled the same way.

It works just as expected in a content block, but not so in a template file. Here’s the code to embed into the template:

 NOTE: To use this code, you will need to remove the spaces inside the brackets before ’embed’ and ‘/embed’.

Comments are closed.