Skip to content

Instantly share code, notes, and snippets.

@Tabrisrp
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tabrisrp/b861b430b86e869873ad to your computer and use it in GitHub Desktop.
Save Tabrisrp/b861b430b86e869873ad to your computer and use it in GitHub Desktop.
<?php
if ( have_rows( 'repeater_field', $order_id ) ) :
while ( have_rows( 'repeater_field', $order_id ) ) : the_row();
$type = get_sub_field( 'type', $order_id );
if( $type === 'tekst' ): ?>
<div id="customerMessageTxt">
<?php the_sub_field($type, $order_id); ?>
</div>
<?php elseif( $type === 'memo' ): ?>
<div id="customerMessageMemo">
<audio id="wp_mep_1" src="<?php the_sub_field($type, $order_id); ?>" type="audio/mp3" controls="controls" preload="auto" >
<object width="709" height="50" type="application/x-shockwave-flash" data="http://localhost:8888/spiritcard.dk/wp-content/plugins/media-element-html5-video-and-audio-player/mediaelement/flashmediaelement.swf">
<param name="movie" value="http://localhost:8888/spiritcard.dk/wp-content/plugins/media-element-html5-video-and-audio-player/mediaelement/flashmediaelement.swf" />
<param name="flashvars" value="controls=true&amp;file=<?php the_sub_field($type, $order_id); ?>" />
</object>
</audio>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('#wp_mep_1').mediaelementplayer({
m:1
,features: ['playpause','current','progress','duration','volume','tracks','fullscreen']
,audioWidth:709,audioHeight:50
});
});
</script>
</div>
<?php elseif( $type === 'video' ): ?>
<div id="customerMessageVideo">
<video id="wp_mep_1" src="<?php the_sub_field($type, $order_id); ?>" type="video/mp4" width="709" height="399" controls="controls" preload="true" >
<object width="709" height="399" type="application/x-shockwave-flash" data="http://localhost:8888/spiritcard.dk/wp-content/plugins/media-element-html5-video-and-audio-player/mediaelement/flashmediaelement.swf">
<param name="movie" value="http://localhost:8888/spiritcard.dk/wp-content/plugins/media-element-html5-video-and-audio-player/mediaelement/flashmediaelement.swf" />
<param name="flashvars" value="controls=true&amp;file=<?php the_sub_field($type, $order_id); ?>" />
</object>
</video>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('#wp_mep_1').mediaelementplayer({
m:1
,features: ['playpause','current','progress','duration','volume','tracks','fullscreen']
});
});
</script>
</div>
<?php else : ?>
<p>type var not working</p>
<?php endif;
endwhile;
else : ?>
<p>have rows not working</p>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment