I’ve had a few clients contact me regarding this, some for our plugins and others for sites I maintain. While the problem does not exist in any of our plugins, I thought I would share what I’ve learned and how I was able to fix the problem.
If portions of your WordPress site have stopped working, like dynamic navigation, hide/show elements, galleries, etc. you may be experiencing this issue as well.
‘Syntax error, unrecognized expression: a[href*=#]’ or
‘Syntax error, unrecognized expression: a[href*=#]:not([href=#])’
Syntax error, unrecognized expression: RESOLVED
In this case: ‘a[href*=#]‘ became: ‘a[href*=”#”]‘. Once all of the code changes were in place and uploaded to the site – VIOLA!! Everything was back to working the way it should be.
WP 4.5 and jQuery Syntax Error
The main issue has been caused by the bundled jQuery that comes with the WordPress core has been updated to version 1.12.2. This new jQuery version is much more strict on the syntax passed in. This means the problematic snippets need to have the ‘href’ attribute value wrapped in quotes to be valid and quiet down the jQuery police.
Here some mentions of the problem in the WordPress forums: https://wordpress.org/support/topic/wp-45-and-jquery-syntax-error
And here it is again on the jQuery GitHub Repository: https://github.com/jquery/jquery/issues/2885