No unit listed in coursepress pro

In coursepress pro there is no unit listed in the unit pages. When the page is loaded, I got the error jQuery(...).knob is not a function.

The site is using a child theme of coursepress but there is no modification made yet.

  • Predrag Dubajic
    • Support

    Hey @Genevieve,

    Hope you're doing well today :slight_smile:

    Just to be clear here, you have created child theme of the CoursePress theme that comes with the plugin, is that correct?
    Can you try switching to parent theme and check if the issue is still there after that?

    If this doesn't give any result would you mind allowing support access so we can have a closer look at this?
    To enable support access you can check the screenshot attached below.

    Best regards,
    Predrag

    • Genevieve
      • Site Builder, Child of Zeus

      Hi Predrag,

      Thanks for your quick response. I switch the site to the default coursepress theme but the problem is still there.
      I have activated the support access. The problem is in the site "outils pour entrepreneurs". I left the theme on the default coursepress theme.

  • Predrag Dubajic
    • Support

    Hi Genevieve,

    Thanks for granting access, I checked your site and can see the jQuery issue, but the strange thing is that we only experienced this with Divi theme in the past...

    You might want to try creating mu-plugin with this code to see if that works:

    function remove_cp_hooks(){
       global $coursepress;
       if ( is_page( 'checkout' ) ) {
       remove_action( 'wp_enqueue_scripts', array( $coursepress, 'header_actions' ) );
       }
    }
    
    add_action('template_redirect', 'remove_cp_hooks');

    However, my first suggestion would be to update your WordPress and CoursePress to latest version to see if that fixes it without applying above code.

    Best regards,
    Predrag

  • Genevieve
    • Site Builder, Child of Zeus

    Hi Predrag,

    Updating the CoursePress to the latest version made it. Unfortunately, it appears that the coursepress pro plugin was cutomized for another web site within our multisite and the update break the other site.

    So, while i'm trying to figure out what customizations have been made, I would like to use your second solution. I added the code you suggest in function.php of my child theme but with no success. Is the code should work in function.php or it really need to be in a plugin?

    UPDATE: I compared my plugin v.1.2.6.4 with the plugin in WPMUDEV site and I found no differences between the plugins. My assumption of a modified plugin was bad.

  • Predrag Dubajic
    • Support

    Hi Genevieve,

    Can you tell me what's the exact issue that happens on that subsite?

    Did you try enabling wp_debug in your wp-config.php to see if any errors will show up that could tell us what's going on?

    Is there anything specific on that subsite, like some additional plugin active that are not on other sites?

    Best regards,
    Predrag

  • Genevieve
    • Site Builder, Child of Zeus

    I finally figured the issue with our customized theme. The array "$units" used in the plugin has changed from plugin version 1.2.6.4 to version 1.2.6.7. The customized theme was looping on the variable $units to display the course unit.
    This is the original loop to display the units with version 1.2.6.4.

    foreach ( $units as $unit ) {
        ...
    }

    This is the new loop to display the units with version 1.2.6.7

    foreach ( $units as $tmp_unit ) {
        $unit = $tmp_unit[post];
       ...
    }

    Thanks for you help.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.