Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript fitvids.js issue (different than other thread…)

  • This topic is empty.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #155903
    deeve007
    Participant

    Hey folks,

    Have a bit of a weird one occurring on a new “blank” WordPress theme I’m starting to put together.

    If I try to use fitvids with the default WordPress loaded Jquery it doesn’t work at all. You can see this occurring here: http://zavahost.com/wordpress/

    As you can see from viewing source, WordPress’ Jquery is loading, as is fitvids, and the function is called via the theme’s JS file.

    But if I go and load Jquery from Google using the enqueue method, or even hard coded into the header, then it all works perfectly.

    You can see the current code here: https://github.com/deeve007/ZavaBlank

    Tried a whole range of different ideas to bug fix, but no joy yet. Any help greatly appreciated.

    Cheers, Dave

    #155906
    chrisburton
    Participant
    // fitvids to make all videos full width http://fitvidsjs.com/  
    jQuery(document).ready(function(){
        // Target your .container, .wrapper, .post, etc.
        jQuery("#content").fitVids();
    });
    

    Screenshot: http://cloud.chrisburton.me/SS04

    #155908
    chrisburton
    Participant

    That’s why I stick with Kirby. WordPress is too much of a hassle. I’ve recently started syncing my Kirby setup from Dropbox to my server — it’s an incredible workflow.

    #155928
    Alen
    Participant
    function google_jquery_cdn() {
     if ( !is_admin() ) {
      wp_deregister_script('jquery');
      wp_register_script( 'jquery',  'http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js', array(), '1.10.2', true );
      wp_enqueue_script('jquery');
     }
    }
    add_action('wp_enqueue_script ', 'google_jquery_cdn');
    

    why not hook into jquery and replace it with your version. you can even include local copy if you dont want to us cdn.

    wp_register_script( 'jquery', get_template_directory_uri() . '/path/to/script.js', array(), '1.10.2', true );

    #155962
    chrisburton
    Participant

    Why is that? I thought it was best to use Google’s since most people have that cached.

    #155970
    chrisburton
    Participant

    If only they would take into consideration of not putting 10 classes on so many elements and figure out a way to condense the codebase so there is not so many files and folders. Exactly why I picked Kirby. Better flexibility and easier to integrate features such as custom fields and post types.

    #155974
    chrisburton
    Participant

    That’s the thing, I don’t see why it wouldn’t fit majority of situations.

    #155980
    Alen
    Participant

    Right, it comes to what you are building and if de-registering jquery is what will solve your issue then go ahead, I don’t think there is right or wrong answer here. I personally, don’t like using many plug-ins. WordPress core PHP code is crap and in addition you have to trust 3rd party plug-ins. I don’t know. I want my CMS to be CMS not dictate how I integrate other features, etc. If I can I will manage my own dependencies within my theme folder.

    Re: Kirby, it seems like a great solution but I haven’t spent much time working with it so I can’t make a conclusive observation. I’m imagining type of user like, writers, where they’re already used to managing lots of individual documents. Could be something that fits their frame of mind. Writing all the document in markdown is great as well. If you ever need to transcribe it to plan HTML, very easy. Anyways, I’ve rambled enough. :)

    #155992
    Alen
    Participant

    Feel free to start another thread folks, this one’s been solved!

    I’m not sure why people are so confrontational and have panties in a bunch about what they use. I think we can have civil discussion, not a debate. We’re all here to learn. I’ve been doing this for very long time. If anyone can remember GioCities. Yup. And I find my self always learning something by participating in healthy discussions. While my interest for Kirby is there, this could have been a discussion that someone could have benefited from, instead, let’s create more threads, your issue was solved.

    #155999
    Alen
    Participant

    Have a great day dude. I really mean it.

    #156007
    chrisburton
    Participant

    Hilarious.

Viewing 11 posts - 1 through 11 (of 11 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.