PageRenderTime 41ms CodeModel.GetById 11ms RepoModel.GetById 1ms app.codeStats 0ms

/patricialutz-custom/content-audio.php

https://github.com/misfist/patricia-lutz.com
PHP | 49 lines | 43 code | 2 blank | 4 comment | 11 complexity | f06d888fa6334b8cb9bf6d9e733a4c8f MD5 | raw file
  1. <?php
  2. /**
  3. * @package WordPress
  4. * @subpackage Chunk
  5. */
  6. ?>
  7. <div <?php post_class(); ?> id="post">
  8. <div class="entry-meta">
  9. <?php if ( ! is_page() ) : ?>
  10. <div class="date"><a href="<?php the_permalink(); ?>"><?php the_time( 'M d Y' ); ?></a></div>
  11. <?php endif; ?>
  12. <?php if ( comments_open() || ( '0' != get_comments_number() && ! comments_open() ) ) : ?>
  13. <div class="comments"><?php comments_popup_link( __( 'Leave a comment', 'quintus' ), __( '1 Comment', 'quintus' ), __( '% Comments', 'chunk' ) ); ?></div>
  14. <?php endif; ?>
  15. <span class="cat-links"><?php the_category( ', ' ); ?></span>
  16. <?php edit_post_link( __( 'Edit', 'chunk' ), '<span class="edit-link">', '</span>' ); ?>
  17. </div>
  18. <div class="main">
  19. <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'chunk' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  20. <div class="entry-content">
  21. <?php $audio_file = chunk_audio_grabber( $post->ID ); ?>
  22. <?php if ( ! empty( $audio_file ) ) : ?>
  23. <div class="player">
  24. <audio controls autobuffer id="audio-player-<?php echo $post->ID; ?>" src="<?php echo $audio_file; ?>">
  25. <source src="<?php echo $audio_file; ?>" type="audio/mp3" />
  26. </audio>
  27. <script type="text/javascript">
  28. var audioTag = document.createElement( 'audio' );
  29. if ( ! ( !! ( audioTag.canPlayType ) && ( "no" != audioTag.canPlayType( "audio/mpeg" ) ) && ( '' != audioTag.canPlayType( 'audio/mpeg' ) ) ) ) {
  30. AudioPlayer.embed(
  31. "audio-player-<?php echo $post->ID; ?>", {
  32. soundFile: "<?php echo $audio_file; ?>",
  33. animation: 'no',
  34. width: '300'
  35. }
  36. );
  37. }
  38. </script>
  39. </div>
  40. <?php endif; ?>
  41. <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'chunk' ) ); ?>
  42. <?php wp_link_pages( array( 'before' => '<p class="page-link"><span>' . __( 'Pages:', 'chunk' ) . '</span>', 'after' => '</p>' ) ); ?>
  43. </div>
  44. <?php the_tags( '<span class="tag-links"><strong>' . __( 'Tagged', 'chunk' ) . '</strong> ', ', ', '</span>' ); ?>
  45. </div>
  46. </div>
  47. <?php comments_template( '', true ); ?>