Home › Forums › JavaScript › fitvids.js issue (different than other thread…)
- This topic is empty.
-
AuthorPosts
-
November 12, 2013 at 9:11 pm #155903deeve007Participant
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
November 12, 2013 at 10:35 pm #155906chrisburtonParticipant// 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
November 12, 2013 at 11:32 pm #155908chrisburtonParticipantThat’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.
November 13, 2013 at 6:54 am #155928AlenParticipantfunction 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 );
November 13, 2013 at 12:43 pm #155962chrisburtonParticipantWhy is that? I thought it was best to use Google’s since most people have that cached.
November 13, 2013 at 1:27 pm #155970chrisburtonParticipantIf 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.
November 13, 2013 at 1:44 pm #155974chrisburtonParticipantThat’s the thing, I don’t see why it wouldn’t fit majority of situations.
November 13, 2013 at 2:00 pm #155980AlenParticipantRight, 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. :)
November 13, 2013 at 2:24 pm #155992AlenParticipantFeel 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.
November 13, 2013 at 2:39 pm #155999AlenParticipantHave a great day dude. I really mean it.
November 13, 2013 at 3:52 pm #156007chrisburtonParticipantHilarious.
-
AuthorPosts
- The forum ‘JavaScript’ is closed to new topics and replies.