-
AuthorPosts
-
August 28, 2014 at 1:56 pm #94204
Hello,
My apologies if this question is answered elsewhere; my searching didn’t find it.
What is the correct procedure for implementing jquery calls?
I wanted to implement this script: http://enrollware.com/registration/feed-demo/ on my site, wordpress.bhmedicaltraining.com, and can’t seem to do it correctly.
I tried putting the .js file in the js folder, and I also tried copying and pasting it into the customizr, but when I place the call in a page it doesn’t work.
Am I doing something wrong? Where should I place the js?
ThanksAugust 28, 2014 at 2:49 pm #94264Hi There,
I think you should setup a child theme first. Then add the the js & css files into it. Then add the jquery codes via Customizer.
And please talk to their customer support about this issue, they must have better solution about implementing their codes into a WordPress site.
August 31, 2014 at 1:44 pm #95815Hi, I’ve done as you suggested, but with no results. See attachment for my file structure (I’ve tried putting the js in its own folder in the child theme, as well as in the root).
Then I put “$(‘#container’).enrollware({
feed: “http://your-site-name.enrollware.com/registration/schedule-feed.ashx?courseid=your-course-id”
});” in the customizer (with my own values, of course)
Is there something else I ought to be doing?
ThanksAugust 31, 2014 at 2:45 pm #95844Hi There,
Did they told anything about the process to you?
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
August 31, 2014 at 9:27 pm #95963This reply has been marked as private.August 31, 2014 at 9:34 pm #95966Hi Eappel,
It should be like this.
jQuery(function($){ $('#container').enrollware({ feed: "http://your-site-name.enrollware.com/registration/schedule-feed.ashx?courseid=your-course-id" }); });
Or this,
jQuery(function($){ $(document).ready(function(){ $('#container').enrollware({ feed: "http://your-site-name.enrollware.com/registration/schedule-feed.ashx?courseid=your-course-id" }); }); });
That is of course will work if jquery plugin enrollware is loaded.
Thanks.
September 1, 2014 at 12:18 pm #96336Thank you. Where do I put this: <script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js” type=”text/javascript”></script>
September 1, 2014 at 2:12 pm #96408Hi Eappel,
You can edit your Child Theme’s function.php file and do one of the following.
Option 1: The best practice is to add JS code into the footer area. You can use the following code to do so.
add_action('wp_footer','custom_footer_script'); function custom_footer_script() { ?> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> <?php }
Option 2: However if you want to add your script to the header area, you can use the below code.
add_action('wp_header','custom_header_script'); function custom_header_script() { ?> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> <?php }
Hope that helps 🙂
September 1, 2014 at 8:13 pm #96622Thanks for walking me through it! I got it running
September 1, 2014 at 8:24 pm #96627Glad to hear that.
Cheers
-
AuthorPosts