0

I understand the video shortcodes work fine when inserted into a post. Easy.

What about when you want to have more control about where the video should be displayed. I would like to use something like:

do_shortcode('[video webm="http://mb2013.mercerbell.com.au/wp-content/uploads/2013/10/sample_mpeg4.webmhd.webm" width="640" height="360" autoplay="true" loop="true"]')

or using the prebuilt WP function:

wp_video_shortcode( array('webm'=>'http://mb2013.mercerbell.com.au/wp-content/uploads/2013/10/sample_mpeg4.webmhd.webm") )

Neither of these solutions seem to work.

As anyone else managed to get this to work? Outside of the embedding it in a post scenario?

Much Appreciated.

3

From the looks of it, you aren't echo-ing the do_shortcode function, which you should.

Try this:

<?php

    echo do_shortcode('[video webm="http://mb2013.mercerbell.com.au/wp-content/uploads/2013/10/sample_mpeg4.webmhd.webm" width="640" height="360" autoplay="true" loop="true"]');

?>
  • Thanks Just having a dig into the wordpress code, this seems to work. <?php echo wp_video_shortcode(array('src'=>'mb2013.mercerbell.com.au/wp-content/uploads/2013/10/…) ); ?> I would like to be able to add in multiple video files, flash backup support and responsiveness. I'll update when I figure it out. :) – Michael Oct 24 '13 at 10:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.