Created
October 10, 2016 23:55
-
-
Save Allan-W-Smith/d683c9eb7234a80e505b2008bd4cae39 to your computer and use it in GitHub Desktop.
Old Wordpress Themes in 4.5 fix : Syntax error, unrecognized expression: [href=#]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Since Wordpress 4.5 alot of old themes throw an error similar to: Syntax error, unrecognized expression: [href=#] */ | |
| /* If updating your themes/plugins doesnt resolve the issue, add this to bottom of the current themes functions.php */ | |
| add_action( 'wp_enqueue_scripts', 'fix_jquery', 100 ); | |
| function fix_jquery() { | |
| if ( ! is_admin() ) { | |
| wp_deregister_script( 'jquery' ); | |
| wp_register_script( 'jquery', ( "//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js" ), false, '1.11.3' ); | |
| wp_enqueue_script( 'jquery' ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment