Problem with Learnpress (Using Sydney Theme, by aThemes)

Hello!

Well, i have an annoying problem.
I installed the Sydney theme, then i “plugged in” the learnpress. Ok, doing fine, created a course and some lessons for testing…but there it is: when the user click on the lesson, the selected item keep loading forever, nothing appears.
Already reinstalled, cleaned the cache, database…the only thing that i could diagnose is seven errors from two different files.

Here go the screenshots:

Before entering the lesson

Error Screenshot

Well, i havent customized the site yet, just found this bug and want to fix it first.
I hope it has been clear, I count on the help of the experienced – I’m new in this area, started an internship and I’m trying to progress.

Hello there,

I am not sure that it’s theme related issue. To rule out theme specific issue, try to switch to the default WordPress theme like Twenty Seventeen. Does the issue remain? Please let me know.

Regards,
Kharis

Hi,

I am also facing the same problem when using learnpress plugin with Sydney theme. Below is the error.
Uncaught TypeError: Cannot read property ‘top’ of undefined
at p (main.min.js:1)
at HTMLDocument.<anonymous> (main.min.js:1)
at i (jquery.js:2)
at Object.fireWith [as resolveWith] (jquery.js:2)
at Function.ready (jquery.js:2)
at HTMLDocument.K (jquery.js:2)

Hi,

i have problems with Sydney theme, learnpress works with Twenty Seventeen, but doesn’t´t work with Sidney theme.

Hello there,

Please share your site URL here, so I can take a closer look to find which line of code which is causing that error.

Regards,
Kharis

Hi,

This is my url

http://edelsa.es/dptopromo/curso/formacion-profesional-ele/lecciones/introduccion/

Hello there,

Thank you for sharing. I am inspecting the trouble now.

Meanwhile, please check your WordPress version and make sure you’ve run the latest version as well as your Learnpress plugin. Let me know how it resolves the issue.

Regards,
Kharis

I’m using the last version of wordpress and learnpress.

Thank you.

Hello there,

To troubleshoot this issue, please try doing the below steps:

  1. Open the js/main.js in your code editor, then copy the whole content of it; then paste it into js/main.min.js. So it will be more readable

  2. In the js/main.min.js, find and remove this code block:


$(function() {
	$('.mainnav a[href*="#"], a.roll-button[href*="#"], .smoothscroll[href*="#"]').on('click',function (e) {
	    var target = this.hash;
	    var $target = $(target);

		if ( $target.length ) {
	    	e.preventDefault();
			$('html, body').stop().animate({
			     'scrollTop': $target.offset().top - 70
			}, 900, 'swing');
	        
	        if($('#mainnav-mobi').length) $('#mainnav-mobi').hide();
	        return false;
		}
	});
});

  1. Save the changes, then update it through FTP or cPanel

Let me know how it goes.

Regards,
Kharis

Hi again, thank you so much for your help.

I tried it but it doesn’t work.

TypeError: $(…).offset(…) is undefined[Saber más] main.min.js:234:20
headerFixed http://edelsa.es/dptopromo/wp-content/themes/sydney/js/main.min.js:234:20
<anónimo> http://edelsa.es/dptopromo/wp-content/themes/sydney/js/main.min.js:453:3
i http://edelsa.es/dptopromo/wp-includes/js/jquery/jquery.js:2:27444
fireWith http://edelsa.es/dptopromo/wp-includes/js/jquery/jquery.js:2:28213
ready http://edelsa.es/dptopromo/wp-includes/js/jquery/jquery.js:2:30004
K http://edelsa.es/dptopromo/wp-includes/js/jquery/jquery.js:2:30366

Hi Kharis, did you see my lastest post?

Thank you so much.

Hello there,

I am sorry for the long delay.

Please find this code block in you main.min.js file.


var headerFixed = function() {
    var headerFix = $('.site-header').offset().top;
    $(window).on('load scroll', function() {
      var y = $(this).scrollTop();
      if ( y >= headerFix) {
        $('.site-header').addClass('fixed');
        $('body').addClass('siteScrolled');
      } else {
        $('.site-header').removeClass('fixed');
        $('body').removeClass('siteScrolled');
      }
      if ( y >= 107 ) {
        $('.site-header').addClass('float-header');
      } else {
        $('.site-header').removeClass('float-header');
      }
    });
};

Then replace it with:


var headerFixed = function() {

};

Update the changes, then reload your page.

Let me know how it goes.

Regards,
Kharis

Hi Kharis:

This change do learnpress works, the problem now is the fixed header doesn´t work.

You can see the issue here:
http://edelsa.es/dptopromo/

Than you so much for your help.