tareq1988

youtube colorbox

Nov 24th, 2011
51
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php if ( $video = get_post_meta( $post->ID, 'cf_video', true ) ) { ?>
  2.     <?php
  3.     $parse = parse_url( $video );
  4.  
  5.     if ( $parse ) {
  6.         parse_str( $parse['query'], $video );
  7.         if ( $video['v'] ) {
  8.             ?>
  9.             <div class="video" style="background: #9fbe4b"><a class="youtube" href="http://www.youtube.com/embed/<?php echo $video['v']; ?>?&wmode=transparent">Video</a></div>
  10.             <?php
  11.         }
  12.     }
  13. }
  14. ?>
  15. <script type="text/javascript">
  16. jQuery(document).ready(function($) {
  17.     $(".youtube").colorbox({ iframe:true, innerWidth:425, innerHeight:344 });
  18. });
  19. </script>
RAW Paste Data