views:

160

answers:

1

I have never messed with wordpress much and am real stuck. I am trying to add a video playlist/gallery via jquery. Not a wordpress plugin. I am not even sure what I am doing wrong and am hoping someone could help me through it please. The site is here, http://okaysewwhat.com/ it is just a skeleton now since this does not work yet. The jquery plugin I am using is this, http://www.geckonewmedia.com/blog/2009/8/14/jquery-youtube-playlist-plugin---youtubeplaylist

Ok so I have inside the header.php of wordpress, added this to call the stylesheet for the youtube part,

<link rel="stylesheet" type="text/css" media="all" href="<?phpbloginfo('stylesheet_url'); ?>/youtube.css" />

then after that is this part, you can see what I added,

 <?php


  wp_enqueue_script("jquery");

  if ( is_singular() ) wp_enqueue_script( 'comment-reply' );



  wp_head(); 

  global $options;
  foreach ($options as $value) {
    if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }
  }
 ?>

<script src="<?php bloginfo('template_directory'); ?>/jquery.youtubeplaylist.js" type="text/javascript" charset="utf-8"></script>


<script type="text/ecmascript">
jQuery.noConflict();

 $(function() {
  $("ul.demo2").ytplaylist({addThumbs:true, autoPlay: false, holderId: 'ytvideo2'});
 });

</script>

Inside index.php I added, right under the wordpress main_col div,

<?php include (TEMPLATEPATH . '/tube.php'); ?>

and all that is in tube.php is the list of vids,

<code>
    <div class="yt_holder">
    <div id="ytvideo2"></div>
    <ul class="demo2">
        <li><a href="http://www.youtube.com/watch?v=QBBWKvY-VDc"&gt;Video 1</a></li>
        <li><a href="http://www.youtube.com/watch?v=ZXMQqLnRhRI"&gt;Video 2</a></li>
        <li><a href="http://www.youtube.com/watch?v=Wvo-g_JvURI"&gt;Video 3</a></li>
    </ul>
</div>
</code>

I hope this is not too convoluded, I aploogize, I am just so lost in this I do not understand it anymore. All that displays is a list like you would get from the ul above.
And firebug gives me the error

Firebug's log limit has been reached. %S entries not shown.  Preferences  
$ is not a function
okaysewwhat.com()okaysewwhat.com (line 40)
[Break on this error] $(function() {\n

which I dont get either. I would appreciate any tips guys, thank you so much.

+2  A: 

http://docs.jquery.com/Core/jQuery.noConflict

By using this function, you will only be able to access jQuery using the 'jQuery' variable. For example, where you used to do $("div p"), you now must do jQuery("div p").

I had similar problem with Wordpress and jQuery, and this was the fix for me. Hope this works for you, thatryan.
Brian Kim
This has nothing to do with WordPress though. If you're gonna use jQuery.noConflict(); and you'd still like to use something other thatn jQuery.whaterver, just do`var jQ = jQuery.noConflict();` then you can do stuff like `jQ('div').blah blah`
idrumgood
but i change the script function to <code> <script type="text/ecmascript"> jQuery.noConflict(); jQuery(function() { jQuery("ul.demo2").ytplaylist({addThumbs:true, autoPlay: false, holderId: 'ytvideo2'}); }); </script></code>and still nothing, same error....?
thatryan