I have written a short code to display a video off of amazon, and it works. However it is not being placed as expected on the page. I have put the shortcode after the <!--more-->
tag but the video displays before the excerpt ruining the layout of the page-of-excerpts.
The page is entered like this:
A few random paragraphs of content
<!--more-->
[amazon_video file="file.flv"]
The shortode is written like so
function amazon_video($atts){
extract(
shortcode_atts(
array(
'file' => $file
),
$atts
)
);
$url = get_bloginfo('url');
?>
<embed
src='<?php echo $url; ?>/jwplayer/player.swf'
name='player'
width='640'
height='480'
bgcolor='#000000'
allowscriptaccess='always'
allowfullscreen='true'
flashvars='file=<?php echo $file; ?>
&streamer=rtmp://xxxxxxxxxxxxx.cloudfront.net/cfx/st
&provider=rtmp'
autoplay="false"
/>
<?php
}
add_shortcode('amazon_video','amazon_video');
The page in question is here incase you wanted to have a look but you may run into some member permissioning.
Essentially, the video is being called last and below the excerpt but is being displayed first and above the excerpt.