Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #94204

    eappel
    Participant

    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?
    Thanks

    #94264

    Mrinal
    Member

    Hi 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.

    #95815

    eappel
    Participant

    Hi, 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?
    Thanks

    #95844

    Mrinal
    Member

    Hi 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 credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #95963

    eappel
    Participant
    This reply has been marked as private.
    #95966

    Rad
    Moderator

    Hi 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.

    #96336

    eappel
    Participant

    Thank 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>

    #96408

    Darshana
    Moderator

    Hi 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 🙂

    #96622

    eappel
    Participant

    Thanks for walking me through it! I got it running

    #96627

    Kosher K
    Member

    Glad to hear that.

    Cheers