Error when trying to use Canvas HTML with the latest version of Wordpress (4.5.2

5 replies · opened Jun 2, 2016

GgonzalobustosJun 2, 2016

The error is:

Uncaught Error: Syntax error, unrecognized expression: a[href*=#]:not([href=#])

More info here, here, and a solution here

Can you reproduce this error and, if necessary, provide a fix?

HheadrushJun 2, 2016

This is a HTML only template and not compatible with wordpress in any way, if you are trying to install as a theme on wordpress that's why you get the error. For wordpresss you can only use a wordpress theme.

GgonzalobustosJun 2, 2016

Of course I'm trying to adapt Canvas HTML templates to a custom wordpress theme.

The cause of the error is that wordpress latest version ships with jQuery v1.12.3 and Canvas uses v.1.11.3 and the following is a valid selector under 1.11.2:

$('.class a[href=#anchor]');

but it fails under 1.12.0 because requires the quotes:

$('.class a[href="#anchor"]');

See the bug

Of course I can do de-register the jquery file used by wordpress and enqueue the one that works with Canvas but I prefer the template author adapt the code to the latest version of jQuery.

SSemicolon WebSTAFFJun 3, 2016

Hello,

Please find the following code in the pageTransition: function() Function Block in the js/functions.js File:

linkElement : '#primary-menu ul li a:not([target="_blank"]):not([href*=#]):not([data-lightbox])',

and replace it with:

linkElement : '#primary-menu ul li a:not([target="_blank"]):not([href*="#"]):not([data-lightbox]):not([href^="mailto"]):not([href^="tel"]):not([href^="sms"]):not([href^="call"])',

This will definitely fix the issue. Let us know if we can help you with anything else or if you find any further issues.

TthiagobertolettiJun 3, 2016

Hello, we are having the same problem here, the Canvas support have forecast to update jquery version?

SSemicolon WebSTAFFJun 5, 2016

Hello @thiagobertoletti,

You Issue will resolved by using the above mentioned solution. Yes, we are updating the jQuery in the Next Update.

Do let us know if we can help you with anything else or if you find any further issues with Canvas.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard